Advertisement
Guest User

Street Sweeping Job by ThePhenix.

a guest
Feb 5th, 2013
1,888
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. //Made by ThePhenix from SA-MP forums.
  2.  
  3. #include <a_samp>
  4.  
  5. new stimer;
  6.  
  7. //===============Modifie it as you want===================================//
  8. #define WAIT_TIME 60000
  9. //======================================================================//
  10.  
  11. public OnFilterScriptInit()
  12. {
  13. print("[FILTERSCRIPT]Street Sweeping Job has loaded successfully");
  14. return 1;
  15. }
  16. public OnFilterScriptExit()
  17. {
  18. print("[FILTERSCRIPT]Street Sweeping Job has unloaded successfully");
  19. return 1;
  20. }
  21.  
  22. public OnPlayerStateChange(playerid, newstate, oldstate)
  23. {
  24. if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
  25. {
  26. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 574)
  27. {
  28. stimer = SetTimerEx("Sweeping", WAIT_TIME, true, "d", playerid);
  29. SendClientMessage(playerid, 0x58E11EC8, "You are now Street Sweeping to earn money. Drive around and earn money!");
  30. }
  31.  
  32. }
  33. return 1;
  34. }
  35. public OnPlayerExitVehicle(playerid, vehicleid)
  36. {
  37. if(GetVehicleModel(vehicleid) == 574)
  38. {
  39. KillTimer(stimer);
  40. SendClientMessage(playerid, 0x58E11EC8, "You are no longer doing your Street Sweeping Job!");
  41. }
  42. return 1;
  43. }
  44.  
  45.  
  46. forward Sweeping(playerid);
  47. public Sweeping(playerid)
  48. {
  49. new string[128];
  50. new rand = 200 + random(210);
  51. GivePlayerMoney(playerid, rand);
  52. format(string, sizeof(string), "You have received $%d for your Street Sweeping Job!", rand);
  53. SendClientMessage(playerid, 0x58E11EC8, string);
  54. return 1;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement