Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#define FILTERSCRIPT
- #include <a_samp>
- #define MAX_STINGER 10 //You can increase it .
- #define white 0xFFFFFFAA
- forward PlayerToPoint(Float:radi,playerid,Float:x,Float:y,Float:z);
- forward stinger();
- forward StopVehicle(playerid);
- new sting[MAX_STINGER], Float:Rot[4][MAX_STINGER];
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- //STINGERS:
- CreateStinger(0,332.2, 2503.8, 15.8);
- CreateStinger(1,332.2+15, 2503.8+15, 15.8);
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- print("Stinger script");
- SetTimer("stinger",40,1);
- MAXPLAYERS = GetMaxPlayers();
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/ts", cmdtext, true, 10) == 0)
- {
- stock CreateStinger(id,Float:X,Float:Y,Float:Z)
- {
- sting[id] = CreateObject(1593,X,Y,Z,0,0,0);
- GetObjectPos(sting[id],Rot[1][id],Rot[2][id],Rot[3][id]);
- return id;
- }
- OnPlayerCrossStinger(playerid,stingerid)
- {
- if(!IsPlayerInAnyVehicle(playerid)) return false;
- PlayerPlaySound(playerid,32000,0,0,0);
- SetVehicleToRespawn((GetPlayerVehicleID(playerid)));
- GameTextForPlayer(playerid,"~r~Stinger!",5000,5);
- #pragma unused stingerid
- return true;
- }
- public stinger()
- {
- for(new i = 0; i < MAX_STINGER; i++)
- {
- for(new pi = 0; pi <MAXPLAYERS; pi++)
- {
- if(PlayerToPoint(1.2,pi,Rot[1][i],Rot[2][i],Rot[3][i]))
- {
- OnPlayerCrossStinger(pi,i);
- }
- }
- }
- }
- public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- return 0;
- }
- return 1;
- }
- return 0;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement