if(strcmp(cmd, "/prison",true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] < 1338) { SendClientMessage(playerid, COLOR_GREY, " Ne ste ovlasteni za taa komanda !"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /prison [playerid/PartOfName]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* Go zatvorivte %s vo Popraven dom.", giveplayer); SendClientMessage(playerid, COLOR_LIGHTRED, string); format(string, sizeof(string), "* Zatvoreni ste vo popraven dom od admin %s.", sendername); SendClientMessage(giveplayerid, COLOR_LIGHTRED, string); GameTextForPlayer(giveplayerid, "~w~Dobrodojdovte vo ~n~~r~Popraven dom", 5000, 3); WantedPoints[giveplayerid] = 0; WantedLevel[giveplayerid] = 0; PlayerInfo[giveplayerid][pJailed] = 2; PlayerInfo[giveplayerid][pJailTime] = 1000; SetPlayerPos(giveplayerid, 122.69999695,1906.69995117,-53.09999847); SetPlayerPos(giveplayerid, 122.40000153,1928.90002441,-53.09999847); SetPlayerWorldBounds(giveplayerid, 337.5694,101.5826,1940.9759,1798.7453); //285.3481,96.9720,1940.9755,1799.0811 } } else { SendClientMessage(playerid, COLOR_GREY, " Toj igrac e isklucen !"); return 1; } } return 1; }
PlayerInfo[giveplayerid][pJailTime] = 1000; |
if( !strcmp(cmd, "/prison", true) ) { ShowPlayerDialog(playerid,XXX,DIALOG_STYLE_INPUT,"Jail time","How much time will the player remain in prison?:","Accept","Cancel"); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == XXXX) { if(response) { PlayerInfo[giveplayerid][pJailTime] = strval(inputtext); } }