Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Anti-db helicopter by Games
- #include <a_samp>
- new bool:JustSat[MAX_PLAYERS];
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(reason == 50) // 50 - Helicopter Blades
- {
- new Games[256];
- if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER && !JustSat[killerid])
- {
- new Float:Velocity[3];
- GetVehicleVelocity(GetPlayerVehicleID(killerid), Velocity[0], Velocity[1], Velocity[2]);
- if(Velocity[0] == 0 && Velocity[1] == 0 && Velocity[2] == 0)
- {
- format(Games,sizeof(Games),"%s jumped on the screws to the player %s!",PlayerName(playerid),PlayerName(killerid));
- SendClientMessageToAll(0xAFAFAFAA,Games);
- SendClientMessage(playerid,0xAFAFAFAA,"Our server is forbidden to jump on the screws!");
- }
- else
- {
- format(Games,sizeof(Games),"%s Player killed by helicopter blades %s",PlayerName(killerid),PlayerName(playerid));
- SendClientMessageToAll(0xAFAFAFAA,Games);
- Kick(killerid);
- }
- }
- }
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(newstate == PLAYER_STATE_DRIVER)
- {
- JustSat[playerid] = true;
- SetTimerEx("SetJustSat", 5000, 0, "i", playerid);
- }
- return 1;
- }
- forward SetJustSat(playerid);
- public SetJustSat(playerid)
- {
- JustSat[playerid] = false;
- return 1;
- }
- stock PlayerName(playerid)
- {
- new pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pname,sizeof(pname));
- return pname;
- }
Advertisement
Add Comment
Please, Sign In to add comment