Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- new Float:xo[MAX_PLAYERS],Float:yo[MAX_PLAYERS],Float:zo[MAX_PLAYERS];
- new timerantiairbrk[MAX_PLAYERS];
- forward antiairbrk(playerid);
- AntiDeAMX()
- {
- new a[][] =
- {
- "Unarmed (Fist)",
- "Brass K"
- };
- #pragma unused a
- }
- public OnFilterScriptInit()
- {
- AntiDeAMX();
- print("\n-------------------------------------");
- print("| FS PAGAL-SN0P |");
- print("| 2013/04/14 |");
- print("| ANTI AIRBRK |");
- print("-------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- KillTimer(timerantiairbrk[playerid]);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- timerantiairbrk[playerid] = SetTimerEx("antiairbrk", 300, true, "i", playerid);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- xo[playerid] = 0.0;
- yo[playerid] = 0.0;
- zo[playerid] = 0.0;
- KillTimer(timerantiairbrk[playerid]);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- return 1;
- }
- xo[playerid] = 0.0;
- yo[playerid] = 0.0;
- zo[playerid] = 0.0;
- return 0;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- xo[playerid] = 0.0;
- yo[playerid] = 0.0;
- zo[playerid] = 0.0;
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- xo[playerid] = 0.0;
- yo[playerid] = 0.0;
- zo[playerid] = 0.0;
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- xo[playerid] = 0.0;
- yo[playerid] = 0.0;
- zo[playerid] = 0.0;
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- xo[playerid] = 0.0;
- yo[playerid] = 0.0;
- zo[playerid] = 0.0;
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- xo[playerid] = 0.0;
- yo[playerid] = 0.0;
- zo[playerid] = 0.0;
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- xo[playerid] = 0.0;
- yo[playerid] = 0.0;
- zo[playerid] = 0.0;
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- xo[playerid] = 0.0;
- yo[playerid] = 0.0;
- zo[playerid] = 0.0;
- return 1;
- }
- stock IsPlayerInAirPlane(vehicleid)
- {
- switch(GetVehicleModel(vehicleid))
- {
- case
- 460,464,476,511,512,513,519,520,553,577,592,593,//flying vehicle models
- 417,425,447,465,469,487,488,497,501,548,563:
- return true;
- }
- return false;
- }
- stock Float:GetPlayerMoveCount(Float:oldd,Float:neww)
- {
- new Float:ret;
- if(oldd < neww)
- {
- ret = neww - oldd;//tag mismatch
- }
- else if(neww > oldd)
- {
- ret = oldd - neww;//tag mismatch
- }
- else if(neww == oldd)
- {
- ret = 0;
- }
- return ret;
- }
- #define RED 0xFF0000FF
- public antiairbrk(playerid)
- {
- new Float:xt,Float:yt,Float:zt;
- GetPlayerPos(playerid,xt,yt,zt);
- if(!IsPlayerInAirPlane(playerid))
- {
- if(xo[playerid] != 0.0 || yo[playerid] != 0.0 || zo[playerid] != 0.0)
- {
- new Float:xs,Float:ys,Float:zs;
- xs = GetPlayerMoveCount(xo[playerid],xt);
- ys = GetPlayerMoveCount(yo[playerid],yt);
- zs = GetPlayerMoveCount(zo[playerid],zt);
- if(xs >= 16.5 || ys >= 16.5 || zs >= 16.5)
- {
- if(xs <= 50.0)
- {
- SendClientMessage(playerid,RED,"[APSAUGA]Buvau išmestas už naudojamasi AIR-BRK");
- new name[255];
- GetPlayerName(playerid,name,sizeof(name));
- new out[800];
- format(out,sizeof(out),"[APSAUGA] Žaidėjas %s buvo iškikintas naudojantis air-brk",name);
- SendClientMessageToAll(RED,out);
- Kick(playerid);
- }
- }
- }
- }
- GetPlayerPos(playerid,xo[playerid],yo[playerid],zo[playerid]);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement