Advertisement
Guest User

Comanda /jail

a guest
Jul 6th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. if(strcmp(cmd, "/jail", true) == 0)
  2. {
  3. if(IsPlayerConnected(playerid))
  4. {
  5. tmp = strtok(cmdtext, idx);
  6. if(!strlen(tmp))
  7. {
  8. SendClientMessage(playerid, COLOR_GRAD2, "{D580FE}Foloseste:{FFFFFF} /jail [playerid/PartOfName] [time(minutes)]");
  9. return 1;
  10. }
  11. new playa;
  12. new money;
  13. playa = ReturnUser(tmp);
  14. tmp = strtok(cmdtext, idx);
  15. money = strval(tmp);
  16. if (PlayerInfo[playerid][pAdmin] >= 2)
  17. {
  18. if(IsPlayerConnected(playa))
  19. {
  20. if(playa != INVALID_PLAYER_ID)
  21. {
  22. GetPlayerName(playa, giveplayer, sizeof(giveplayer));
  23. GetPlayerName(playerid, sendername, sizeof(sendername));
  24. format(string, sizeof(string), "* You Jailed %s.", giveplayer);
  25. SendClientMessage(playerid, COLOR_LIGHTRED, string);
  26. format(string, sizeof(string), "* You were Jailed by Admin %s.", sendername);
  27. SendClientMessage(playa, COLOR_LIGHTRED, string);
  28. ResetPlayerWeapons(playa);
  29. WantedPoints[playa] = 0;
  30. PlayerInfo[playa][pJailed] = 2;
  31. PlayerInfo[playa][pJailTime] = money*60;
  32. SetPlayerInterior(playa, 0);
  33. JailPrice[id] = 0;
  34. new rand;
  35. rand = random(sizeof(gRandomJailSpawns));
  36. SetPlayerPos(id,gRandomJailSpawns[rand][0],gRandomJailSpawns[rand][1],gRandomJailSpawns[rand][2]);
  37. format(string, sizeof(string), "You are jailed for %d minutes. Bail: Unable", money);
  38. SendClientMessage(playa, COLOR_LIGHTBLUE, string);
  39. format(string, 128, "%s has jailed %s for %d minutes.", sendername,giveplayer,money);
  40. ABroadCast(COLOR_YELLOW,string,1);
  41. TextDrawShowForPlayer(id, JailTD[id]);
  42. }
  43. }
  44. }
  45. else
  46. {
  47. SendClientMessage(playerid, COLOR_GRAD1, " Nu ai dreptul de a utiliza aceasta comanda!");
  48. }
  49. }
  50. return 1;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement