Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <sscanf>
- #include <zcmd>
- #define SECONDS(%0) (%0 * 1000)
- #define MINUTES(%0) (%0 * SECONDS(60))
- new bool:ikalintas[MAX_PLAYERS], liko[MAX_PLAYERS], stringas[128];
- forward Ikalino(playerid);
- public OnPlayerSpawn(playerid)
- {
- if(ikalintas[playerid] == true)
- {
- SetPlayerPos(playerid, 245.0960, 1859.6161, 14.0840);
- format(stringas, 128, "~n~~n~~n~~n~~n~LIKO: %imin.", liko[playerid]);
- GameTextForPlayer(playerid, stringas, SECONDS(65), 0);
- }
- else
- {
- SetPlayerPos(playerid, -1514.5477, 2522.2446, 55.8360);
- }
- return 1;
- }
- public Ikalino(playerid)
- {
- if(liko[playerid] < 1)
- {
- SetPlayerPos(playerid, 87.4332, 1920.5803, 17.8526);
- ikalintas[playerid] = false;
- }
- else
- {
- liko[playerid] --;
- format(stringas, 128, "~n~~n~~n~~n~~n~LIKO: %imin.", liko[playerid]);
- GameTextForPlayer(playerid, stringas, SECONDS(65), 0);
- }
- return 1;
- }
- CMD:ikalinti(playerid, params[])
- {
- if(/* Admin kintamasis */)
- {
- new name, time, reason[50];
- if(sscanf(params, "uis", name, time, reason)) return SendClientMessage(playerid, 0xFF0000FF, "Įkalinti: /ikalinti [Dalis Vardo][Minutės][Priežastis]");
- if(name == INVALID_PLAYER_ID && !IsPlayerNPC(name)) return SendClientMessage(playerid, 0xFF0000FF, "Tokio žaidėjo serveryje nėra.");
- if(name == playerid) return SendClientMessage(playerid, 0xFF0000FF, "Savęs įkalinti negalite.");
- if(ikalintas[name] == true) return SendClientMessage(playerid, 0xFF0000FF, "Žaidėjas jau įkalintas.");
- format(stringas, 128, "Jūs įkalintas administratoriaus %s (laikas: %imin., priežastis: %s)", PlayerName(playerid), time, reason);
- SendClientMessage(name, 0xFF0000FF, stringas);
- ikalintas[name] = true;
- liko[name] = time;
- SetTimerEx("Ikalino", SECONDS(60), 1, "d", name);
- format(stringas, 128, "~n~~n~~n~~n~~n~LIKO: %imin.", liko[name]);
- GameTextForPlayer(playerid, stringas, SECONDS(65), 0);
- }
- return 1;
- }
- PlayerName(id)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(id, name, MAX_PLAYER_NAME);
- return name;
- }
Advertisement
Add Comment
Please, Sign In to add comment