Advertisement
Guest User

Untitled

a guest
Feb 28th, 2013
933
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. // // // // // // // // // // // // // // // //
  2. // //
  3. //SWEEPER JOB MADE BY RADOSLAV_HRISTOV //
  4. //DO NOT CHANGE ANY CREDITS! //
  5. // //
  6. // // // // // // // // // // // // // // // //
  7.  
  8. //You can change the coordinates in line OnFilterscriptInit
  9. //Also you can change the command. I made it /sweeper because it's test command
  10. #include <a_samp>
  11.  
  12. #define COLOR_DARKGOLD 0x808000AA
  13. #define COLOR_RED 0xFF0000AA
  14. #define COLOR_YELLOW 0xFFFF00AA
  15.  
  16. new SweepingJob[256];
  17.  
  18. public OnFilterScriptInit()
  19. {
  20. AddStaticVehicle(574,1424.8956,-1844.7279,13.2739,359.7335,0,0); // Sweeper1
  21. AddStaticVehicle(574,1428.4050,-1844.6340,13.2739,0.7382,0,0); // Sweeper2
  22. AddStaticVehicle(574,1431.9050,-1844.6138,13.2739,1.4491,0,0); // Sweeper3
  23. }
  24. forward SweeperJobFinish(playerid);
  25. public SweeperJobFinish(playerid)
  26. {
  27. if(SweepingJob[playerid] == 0){ return 1; }
  28.  
  29. GivePlayerMoney(playerid, -200);
  30. if(GetPlayerMoney(playerid) > 200)
  31. SendClientMessage(playerid,COLOR_YELLOW,"* You have been payed for your job! - $200");
  32. SweepingJob[playerid] = 0;
  33.  
  34. return 1;
  35. }
  36. public OnPlayerCommandText(playerid, cmdtext[])
  37. {
  38. if (strcmp("/sweeper", cmdtext, true, 10) == 0)
  39. {
  40. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 574)
  41. {
  42. SweepingJob[playerid] = 1;
  43. new name[MAX_PLAYER_NAME], string[48];
  44. GetPlayerName(playerid, name, sizeof(name));
  45. format(string, sizeof(string), "* %s is now a StreetSweeper.", name );
  46. SendClientMessageToAll(COLOR_YELLOW, string);
  47. SendClientMessage(playerid,COLOR_YELLOW,"* Clean the street for 1 minute and recieve $200");
  48. SetTimerEx("SweeperJobFinish", 60000, false, "i", playerid);
  49. return 1;
  50. }
  51. SendClientMessage(playerid, COLOR_RED,"You have to be in a streetsweeper to start the job");
  52. }
  53. return 0;
  54. }
  55. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  56. {
  57. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 574)
  58. {
  59. SendClientMessage(playerid, COLOR_RED, "* You can start the sweepingjob by using /sweeper");
  60. }
  61. return 0;
  62. }
  63. public OnPlayerExitVehicle(playerid, vehicleid)
  64. {
  65. if(SweepingJob[playerid] == 1)
  66. {
  67. SendClientMessage(playerid, COLOR_RED, "* You have left your job, you won't be payed.");
  68. SweepingJob[playerid] = 0;
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement