Guest User

Here is the pastebin-gab1971

a guest
Jun 24th, 2011
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.51 KB | None | 0 0
  1. // Anti-db helicopter by Games
  2. #include <a_samp>
  3.  
  4. new bool:JustSat[MAX_PLAYERS];
  5.  
  6. public OnPlayerDeath(playerid, killerid, reason)
  7. {
  8.     if(reason == 50) // 50 - Helicopter Blades
  9.     {
  10.         new Games[256];
  11.         if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER && !JustSat[killerid])
  12.         {
  13.             new Float:Velocity[3];
  14.             GetVehicleVelocity(GetPlayerVehicleID(killerid), Velocity[0], Velocity[1], Velocity[2]);
  15.             if(Velocity[0] == 0 && Velocity[1] == 0 && Velocity[2] == 0)
  16.             {
  17.                 format(Games,sizeof(Games),"%s jumped on the screws to the player %s!",PlayerName(playerid),PlayerName(killerid));
  18.                 SendClientMessageToAll(0xAFAFAFAA,Games);
  19.                 SendClientMessage(playerid,0xAFAFAFAA,"Our server is forbidden to jump on the screws!");
  20.             }
  21.             else
  22.             {
  23.                 format(Games,sizeof(Games),"%s Player killed by helicopter blades %s",PlayerName(killerid),PlayerName(playerid));
  24.                 SendClientMessageToAll(0xAFAFAFAA,Games);
  25.                 Kick(killerid);
  26.             }
  27.         }
  28.     }
  29.     return 1;
  30. }
  31.  
  32. public OnPlayerStateChange(playerid, newstate, oldstate)
  33. {
  34.     if(newstate == PLAYER_STATE_DRIVER)
  35.     {
  36.         JustSat[playerid] = true;
  37.         SetTimerEx("SetJustSat", 5000, 0, "i", playerid);
  38.     }
  39.     return 1;
  40. }
  41.  
  42. forward SetJustSat(playerid);
  43. public SetJustSat(playerid)
  44. {
  45.      JustSat[playerid] = false;
  46.      return 1;
  47. }
  48.  
  49. stock PlayerName(playerid)
  50. {
  51.     new pname[MAX_PLAYER_NAME];
  52.     GetPlayerName(playerid,pname,sizeof(pname));
  53.     return pname;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment