Advertisement
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_WHITE, "{FF8306}KORISTETE:{FFFFFF}/jail [ID/Ime na Igrac] [minuti] [pricina].");
- return 1;
- }
- new playa;
- new money;
- playa = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- money = strval(tmp);
- if (PlayerInfo[playerid][pAdmin] >= 1)
- {
- 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_WHITE, "{FF8306}KORISTETE:{FFFFFF}/jail [ID/Ime na Igrac] [minuti] [pricina]");
- return 1;
- }
- new rand;
- rand = random(sizeof(gRandomJailSpawns));
- format(string, sizeof(string), "{37F906}INFO:{FFFFFF}Go zatvorivte %s.", giveplayer);
- SendClientMessage(playerid, WHITE, string);
- //format(string, sizeof(string), "{37F906}INFO:{FFFFFF}Administrator %s ve zatvori vo zatvor, Pricina: %s.", sendername, (result));
- //SendClientMessage(playa, WHITE, string);
- SafeResetPlayerWeapons(playa);
- WantedPoints[playa] = 0;
- PlayerInfo[playa][pJailed] = 1;
- //PlayerInfo[playa][pJailed] = 2;
- PlayerInfo[playa][pJailTime] = money*60;
- SetPlayerInterior(playa, 0);
- PlayerInfo[playa][pInt] = 0;
- //SetPlayerPos(playa, 107.2300,1920.6311,18.5208);
- SetPlayerPos(playa, gRandomJailSpawns[rand][0], gRandomJailSpawns[rand][1], gRandomJailSpawns[rand][2]);
- SetPlayerWorldBounds(playa, 337.5694,101.5826,1940.9759,1798.7453);
- SetPlayerSkin(playa, 72);
- TogglePlayerControllable(playa, 0);
- SetTimerEx("UlazuInt",2000, false, "i", playa);
- format(string, sizeof(string), "{37F906}INFO:{FFFFFF}Zatvoreni ste na %d minuti.", money);
- SendClientMessage(playa, COLOR_WHITE, string);
- //format(string, 256, "%s e zatvoren od Administrator %s, Pricina: %s.", giveplayer, sendername, (result));
- //ABroadCast(COLOR_UBAVACRVENA,string,1);
- format(string, sizeof(string), "%s e zatvoren %d minuti vo zatvor od Administrator %s, Pricina: %s.", giveplayer, money, sendername, (result));
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- printf("%s",string);
- OnPlayerUpdate(playa);
- }
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "{FF0000}GRESKA:{FFFFFF}Nemozete da ja koristite ovaa komanda.");
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement