Quantcast
Channel: SA-MP Forums - Filterscripts
Viewing all articles
Browse latest Browse all 595

[FilterScript] Shooting range + Interiors help + Cash textdraw

$
0
0
Hey hi hello once again, after the warm welcome and heart whelming comments and support over my past 2 releases i decided to
make a release once more :picard: (thanks xeon)
I've come to you with a work of about 300 lines, the title breaks it down yes its a filterscript that contains a cash textdraw such as the following :
For more info what happens is you replace all of your GivePlayerMoney to ShowCashTDraw by CTRL+H and
this little textdraw will appear every time u gain cash (only stays for 2 seconds)
regardless of the amount
whether it be negative or positive it works I've tested it so just take out the functions i put in the filterscript regarding that and use them this way, i mean im sure many ppl can create a textdraw but idk
this can be useful to let the players know the amount they gained if you're not sending client messages? and i
like how it looks lol its up to you to use have fun.
====This part you're free to ignore as
it might not be very useful======

Second thing is the interiors help, this is totally entitled to you as well, i wasn't even planning on putting this out
but i just used it as to help me with the next objective ( the shooting range) and its good for starters basically
just making it easier to enter and exit an interior u can use it as ur interiors system if u havent got one or for
test purposes it only takes one line if its a simple one or more lines if you want special functions for that
interior (you'll know what i mean by looking at the script) so yeah one cmd /allinteriors to lock all interiors created using this (for rcon) just putting it out there for ppl to use if needed, here's the syntax :
PHP Code:

EEI(playerid,InteriorID,Float:ix,Float:iy,Float:iz,Float:x,Float:y,Float:z,Float:rot,Interior,World,PerviousWorld); 

And here's the explanation for that syntax :
PHP Code:

/*Use interiors more than once safely and effectively, USEAGE:
playerid --> the player id to teleport inside the desired interior
InteriorID --> the id of the interior for separating them and controlling each on its own ( NOT THE ACTUAL INTERIOR ID)
Float:ix --> the x place to create the interior pickup (the position where the player ENTERS FROM)
Float:iy --> the y place to create the interior pickup (the position where the player ENTERS FROM)
Float:iz --> the z place to create the interior pickup (the position where the player ENTERS FROM)
Float:x --> the x place to TELEPORT the player to ( the interior )
Float:y --> the y place to TELEPORT the player to ( the interior )
Float:z --> the z place to TELEPORT the player to ( the interior )
Float:rot --> the angle heading to make the player look at when he enters the interior
Interior --> the interior you want the player to enter (THE ACTUAL INTERIOR ID)
World --> the world to set for that player once he enters the interior to be able to use that interior later on
Pervious World --> the pervious world the player was just into the moment before he entered the interior ( 0 for enter, custom for exit)
Lock Status --> you can implement the function by an admin to lock/unlock an interior to be enter-able or not, return it 1 to lock & vise versa.
EX: EEI(playerid,CURRENT INTERIOR,IamAtX,IamAtY,IamAtZ,GotoX,GotoY,GotoZ,GotoR,GotoINTERIOR,GOTOWORLD,iWasInWorld);
can be used by linking it to a timer called every second or put it under onplayerkeystatechange and link it to a key(the way i use it)
NOTE: Create your pickup based on the ix,iy,iz floats.
EX: CreatePickup(pickupID, type, ix,iy,iz, world);*/ 

Honestly if u find it too confusing for you just ignore it and extract the code u want out of the filterscript and edit/add things to it i totally don't mind, here's the function:
PHP Code:

public EEI(playerid,InteriorID,Float:ix,Float:iy,Float:iz,Float:x,Float:y,Float:z,Float:rot,Interior,World,PerviousWorld)
{
    if(
GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && IsPlayerInRangeOfPoint(playerid,3.0,ix,iy,iz) && GetPlayerVirtualWorld(playerid) == PerviousWorld && !LockStatus) {
    if(
InteriorID == && !shootingrange) { //your custom interior id install here
    
if(!InRange[playerid]) InRange[playerid]=true;//related to the zoom in on shoot for the SR(shooting range)
    
else InRange[playerid]=false;//save as above ( see what i meant by special functions to the interior?)
    
SetPlayerPos(playerid,x,y,z);
    
SetPlayerVirtualWorld(playerid,World);
    
SetPlayerFacingAngle(playerid,rot);
    
SetPlayerInterior(playerid,Interior); }// now we finished the first interior (shooting range) read below to understand more about the shooting range.
    //EX: else if(InteriorID == 2) { //do stuff here } return 1; //done
    
}
    return 
1;


hope this has helped you somehow...
=====Shooting Range=======
now coming to the last thing which is the shooting range, i don't see many of those on here i did see like 3-4 but
they weren't the same so here's what this is about, first you can bring the shooting range building (dome) up/down
by MoveDynamicObject ( i used streamer yes) to be able to close/open that shooting range that might help people, if u see it to be useless to u just ignore those 2 cmds or even remove them, second of all i acquired help from a function and a code that were made by Lorenc_ & kadaradam , everything about their credits is mentioned in the filterscript itself including the links to their posts, back on topic: you can also move the objects u shoot at by pressing L-ALT while standing into the booth, you can also see where u shot
the target using the bullet cam code( which was made by kadaradam who used Lorenc_ SetObjectFacePoint function, confusing? eh) anyway yes i will update a few shots you'll see it down there of how this shooting range goes, the thing here is once u shoot the object its destroyed so i stacked up 2 targets onto each other
in the 3 targets i added in the shooting range ( the objects will be there once a player re-enters the shooting range) if you can edit that and bend it to ur will you're free to do so, to avoid
more chatter and making the post longer than it already is the cmds are /gotosr , /brintgsrup and /bringtsrdown (the names explain it) only rcon admin as always change that to ur admin system, please report any bugs found or any suggestions u have that u think can make me improve this, thanks, enjoy it.
shooting range shots:
What you can do with this is either link it to a score system or just make it a hangout for a certain level of players.
=====PASTEBIN:=====
Pastebin Link
=== Was going to release all of this yesterday but wrote such an
essay and shut the browser then BAM all is lost,
This'll be the last of me for a bit although I've got
one more idea but busy these days so maybe later, i will
upload files for those who seek direct test, all comments/suggestions/reports are welcome, hope you guys find this one useful.

Credits:

Zeex for ZCMD
Incognito for Streamer
kadaradam for Bullet Cam code
Lorenc_ for SetObjectFacePoint
Me and the original SA-MP provides for the rest.

==============================

Attached Files
File Type: amx SR+IH+CTD.amx (13.4 KB)
File Type: pwn SR+IH+CTD.pwn (13.4 KB)

Viewing all articles
Browse latest Browse all 595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>