Advertisement
Guest User

Untitled

a guest
Dec 17th, 2010
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. #include <a_samp>
  2. #include <admin_menu>
  3.  
  4. new count, counter = 120;
  5. new jail[MAX_PLAYERS];
  6.  
  7. forward Count(playerid);
  8.  
  9. public OnPlayerCommandText(playerid, cmdtext[])
  10. {
  11. if (strcmp("/jailme", cmdtext, true, 10) == 0)
  12. {
  13. ResetPlayerWeapons(playerid);
  14. SetCameraBehindPlayer(playerid);
  15. SetPlayerInterior(playerid,3);
  16. SetPlayerPos(playerid,194.0873,175.3850,1003.0234);
  17. SetPlayerFacingAngle(playerid,20.7011);
  18. new name[MAX_PLAYER_NAME], string[44];
  19. GetPlayerName(playerid, name, sizeof(name));
  20. format(string, sizeof(string), "**(AUTO JAIL)** %s(%d) Do NOT Driveby players who is on foot, Read /rules /pc /commands",name ,playerid);
  21. SendClientMessageToAll(COLOR_ADMINORANGE, string);
  22. count = SetTimer("Count", 1000, true);
  23. jail[playerid] = 1;
  24. return 1;
  25. }
  26. else SendClientMessage(playerid, 0x94FF00FF, "Player is already in jail");
  27.  
  28. if (strcmp("/kill", cmdtext, true, 10) == 0)
  29. {
  30. if(jail[playerid] == 1)//checks if is in jail.
  31. {
  32. SendClientMessage(playerid,COLOR_YOURCHOICE,"You are jailed and may not suicide!");
  33. }
  34. else
  35. {
  36. new name[MAX_PLAYER_NAME], string[44];
  37. GetPlayerName(playerid, name, sizeof(name));
  38. format(string, sizeof(string), "%s(%d) has committed suicide.",name ,playerid);
  39. SendClientMessageToAll(0xFFFF00AA, string);
  40. SetPlayerHealth(playerid, 0);
  41. SetPlayerScore(playerid, GetPlayerScore(playerid)-1);
  42. }
  43. return 1;
  44. }
  45. return 0;
  46. }
  47.  
  48. public Count(playerid)
  49. {
  50. new string[128];
  51. counter--;
  52. format(string, sizeof(string), "JAILTIME: %d",counter);
  53. GameTextForPlayer(playerid, string, 3000,6);
  54. if(counter == 0)
  55. {
  56. SetPlayerInterior(playerid,3);
  57. SetPlayerPos(playerid,210.5272,146.3341,1003.0234);
  58. SetPlayerFacingAngle(playerid,179.4662);
  59. SetCameraBehindPlayer(playerid);
  60.  
  61. new name[MAX_PLAYER_NAME];
  62. GetPlayerName(playerid, name, sizeof(name));
  63. format(string, sizeof(string), "%s(%d) *Released from jail*",name ,playerid);
  64. SendClientMessageToAll(COLOR_RED, string);
  65. KillTimer(count);
  66. jail[playerid] = 0;//sets variable back to 0, so you can suicide if your not in jail.
  67. }
  68. return 1;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement