Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/jail", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /jail [ID/DioImena] [minuta] [razlog]");
- return 1;
- }
- new playa;
- new money;
- playa = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- money = strval(tmp);
- if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGameSage] >= 4)
- {
- if(IsPlayerConnected(playa))
- {
- if(playa != INVALID_PLAYER_ID)
- {
- GetPlayerName(playa, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[128];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /jail [playerid/PartOfName] [time(minutes)] [reason]");
- return 1;
- }
- format(string, sizeof(string), " Zatvorio si igraca %s na %d minuta", giveplayer, money);
- SendClientMessage(playerid, WHITE, string);
- format(string, sizeof(string), "* Admin %s vas je zatvorio u zatvor | Razlog: %s", sendername, (result));
- SendClientMessage(playa, COLOR_YELLOW, string);
- SafeResetPlayerWeapons(playa);
- WantedPoints[playa] = 0;
- PlayerInfo[playa][pJailed] = 1;
- PlayerInfo[playa][pJailTime] = money*60;
- SetPlayerInterior(playa, 0);
- PlayerInfo[playa][pInt] = 0;
- new rand = random(sizeof(gRandomJailSpawns));
- SetPlayerPos(playa, gRandomJailSpawns[rand][0], gRandomJailSpawns[rand][1], gRandomJailSpawns[rand][2]);
- format(string, sizeof(string), "* {DB1414}Zatvoren si na %d minuta | Jamcevina: Nedostupna", money);
- SendClientMessage(playa, COLOR_YELLOW, string);
- format(string, 256, "|JAIL| %s(%d) je zatvoren od Admina %s | Vrijeme: %d | Razlog: %s ", giveplayer, giveplayerid, sendername, money, (result));
- PorukaAdminima(COLOR_RED,string,1);
- printf("%s",string);
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD1, "Odbijeno: Nisi ovlasten!!");
- }
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment