Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- #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
- }
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- AntiDeAMX();
- print("\n-------------------------------------");
- print("| Gamelasters Anti Air Brake Loaded |");
- print("-------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n-------------------------------------");
- print("| Gamelasters Anti Air Brake Loaded |");
- print("-------------------------------------\n");
- }
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- #endif
- public OnPlayerConnect(playerid)
- {
- 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 OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- 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 OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- 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 OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- xo[playerid] = 0.0;
- yo[playerid] = 0.0;
- zo[playerid] = 0.0;
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- 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 IsPlayerSurfingOnVehicle(playerid)
- {
- if(GetPlayerSurfingVehicleID(playerid) != INVALID_VEHICLE_ID)
- return true;
- return false;
- }
- stock IsPlayerInAirPlane(playerid)
- {
- new playerveh = GetPlayerVehicleID(playerid);
- switch(GetVehicleModel(playerveh))
- {
- 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(!IsPlayerSurfingOnVehicle(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,"[GAIB] You Have Kicked for using AirBrake!!!");
- new name[21];
- GetPlayerName(playerid,name,sizeof(name));
- new out[125];
- format(out,sizeof(out),"[GAIB] Player %s has been kicked for using AirBrake!!!",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