Stuneris

JailSystem_LT

Aug 24th, 2011
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.06 KB | None | 0 0
  1. #include <a_samp>
  2. #include <sscanf>
  3. #include <zcmd>
  4.  
  5. #define SECONDS(%0) (%0 * 1000)
  6. #define MINUTES(%0) (%0 * SECONDS(60))
  7.  
  8. new bool:ikalintas[MAX_PLAYERS], liko[MAX_PLAYERS], stringas[128];
  9.  
  10. forward Ikalino(playerid);
  11.  
  12. public OnPlayerSpawn(playerid)
  13. {
  14.     if(ikalintas[playerid] == true)
  15.     {
  16.         SetPlayerPos(playerid, 245.0960, 1859.6161, 14.0840);
  17.         format(stringas, 128, "~n~~n~~n~~n~~n~LIKO: %imin.", liko[playerid]);
  18.         GameTextForPlayer(playerid, stringas, SECONDS(65), 0);
  19.     }
  20.     else
  21.     {
  22.         SetPlayerPos(playerid, -1514.5477, 2522.2446, 55.8360);
  23.     }
  24.     return 1;
  25. }
  26.  
  27. public Ikalino(playerid)
  28. {
  29.     if(liko[playerid] < 1)
  30.     {
  31.         SetPlayerPos(playerid, 87.4332, 1920.5803, 17.8526);
  32.         ikalintas[playerid] = false;
  33.     }
  34.     else
  35.     {
  36.         liko[playerid] --;
  37.         format(stringas, 128, "~n~~n~~n~~n~~n~LIKO: %imin.", liko[playerid]);
  38.         GameTextForPlayer(playerid, stringas, SECONDS(65), 0);
  39.     }
  40.     return 1;
  41. }
  42.  
  43. CMD:ikalinti(playerid, params[])
  44. {
  45.     if(/* Admin kintamasis */)
  46.     {
  47.         new name, time, reason[50];
  48.         if(sscanf(params, "uis", name, time, reason)) return SendClientMessage(playerid, 0xFF0000FF, "Įkalinti: /ikalinti [Dalis Vardo][Minutės][Priežastis]");
  49.         if(name == INVALID_PLAYER_ID && !IsPlayerNPC(name)) return SendClientMessage(playerid, 0xFF0000FF, "Tokio žaidėjo serveryje nėra.");
  50.         if(name == playerid) return SendClientMessage(playerid, 0xFF0000FF, "Savęs įkalinti negalite.");
  51.         if(ikalintas[name] == true) return SendClientMessage(playerid, 0xFF0000FF, "Žaidėjas jau įkalintas.");
  52.         format(stringas, 128, "Jūs įkalintas administratoriaus %s (laikas: %imin., priežastis: %s)", PlayerName(playerid), time, reason);
  53.         SendClientMessage(name, 0xFF0000FF, stringas);
  54.         ikalintas[name] = true;
  55.         liko[name] = time;
  56.         SetTimerEx("Ikalino", SECONDS(60), 1, "d", name);
  57.         format(stringas, 128, "~n~~n~~n~~n~~n~LIKO: %imin.", liko[name]);
  58.         GameTextForPlayer(playerid, stringas, SECONDS(65), 0);
  59.     }
  60.     return 1;
  61. }
  62.  
  63. PlayerName(id)
  64. {
  65.     new name[MAX_PLAYER_NAME];
  66.     GetPlayerName(id, name, MAX_PLAYER_NAME);
  67.     return name;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment