Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. if(strcmp(cmd, "/rac", true ) == 0){
  2. new second;
  3. if(sscanf(cmd, "i", second))
  4. {
  5. SendClientMessage(playerid, 0x33CCFFAA, "Használat: /rac [Másodperc]");
  6. }
  7. if(rac == 1)
  8. {
  9. SendClientMessageToAll(0x33CCFFAA, "Egy újabb autó respawnhoz várnod kell, mert még folyamatban van 1!");
  10. }
  11. if(second > 60)
  12. {
  13. SendClientMessage(playerid, 0x33CCFFAA, "Az autó respawn 1 percnél (60mp) nem lehet több!");
  14. }
  15. else
  16. {
  17. GetPlayerName(playerid, sendername, sizeof(sendername));
  18. format(string, 128, "Minden használaton kívűli jármű %i másodperc múlva újra lesz spawnolva %s álat!", second, sendername);
  19. SendClientMessageToAll(0x33CCFFAA, string);
  20. SetTimer("CarRespawn", second, false);
  21. rac = 1;
  22. }
  23. return 1;
  24. }
  25.  
  26. public CarRespawn()
  27. {
  28. for(new vid = 0; vid < MAX_VEHICLES; vid ++)
  29. {
  30. if(!IsVehicleOccupied(vid))
  31. {
  32. SetVehicleToRespawn(vid);
  33. }
  34. }
  35. rac = 0;
  36. SendClientMessageToAll(0x33CCFFAA, "* Minden használaton kívüli jármű helyreállítva!");
  37. return 1;
  38. }
  39.  
  40. stock IsVehicleOccupied(vehicleid)
  41. {
  42. for(new i = 0; i < MAX_PLAYERS; i++)
  43. {
  44. if(IsPlayerInVehicle(i, vehicleid)) return 1;
  45. }
  46. return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement