Advertisement
Guest User

Pedestrian Script - Lewwy

a guest
Mar 26th, 2011
1,026
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.30 KB | None | 0 0
  1. // Sorry about the messy code, you can optimise it further if you wish!
  2. // - Lewwy
  3.  
  4. #include <a_samp>
  5.  
  6. new droptimer[MAX_PLAYERS],
  7.     restarttimer[MAX_PLAYERS];
  8.  
  9. public OnFilterScriptInit()
  10. {
  11.     print("Pedestrian script by Lewwy");
  12.     return 1;
  13. }
  14.  
  15. public OnPlayerSpawn(playerid)
  16. {
  17.     SetPlayerInterior(playerid, 10);
  18.     SetPlayerPos(playerid, 1961.6940, 1007.0735, 992.4688);
  19.     TogglePlayerControllable(playerid, 0);
  20.     droptimer[playerid] = SetTimerEx("PedDrop", 2500, 0, "i", playerid);
  21.     if(GetPVarInt(playerid, "firsttime") == 0)
  22.     {
  23.         SetPVarInt(playerid, "firsttime", 1);
  24.         SetTimerEx("PedStop", 20000, 0, "i", playerid);
  25.     }
  26.     return 1;
  27. }
  28.  
  29. forward PedDrop(playerid);
  30. public PedDrop(playerid)
  31. {
  32.     SetPlayerInterior(playerid, 0);
  33.     restarttimer[playerid] = SetTimerEx("PedRestart", 2500, 0, "i", playerid);
  34.     return 1;
  35. }
  36.  
  37. forward PedRestart(playerid);
  38. public PedRestart(playerid)
  39. {
  40.     return OnPlayerSpawn(playerid);
  41. }
  42.  
  43. forward PedStop(playerid);
  44. public PedStop(playerid)
  45. {
  46.         KillTimer(droptimer[playerid]);
  47.     KillTimer(restarttimer[playerid]);
  48.     SetPlayerInterior(playerid, 0);
  49.     GivePlayerWeapon(playerid, 46, 1);
  50.     GameTextForPlayer(playerid, "~r~Land on the Four Dragon's Casino Roof!", 2500, 5);
  51.     TogglePlayerControllable(playerid, 1);
  52.     SetPVarInt(playerid, "firsttime", 0);
  53.     return 1;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement