26.05.2011, 15:45
Could someone edit this ban command? I tried to ban a NPC, but i got banned from the server my self.
It would be nice if someone added this and made it work to the command in the OnDialogResponse, I have dificulties saving names and similar stuff from a command to OnDialogResponse, i would be very grateful for it.
Код:
if(!strcmp(cmdtext, "/ban", true,4)) { new vardas[MAX_PLAYER_NAME]; strmid(vardas,GetArgument(1, cmdtext,0),0,MAX_PLAYER_NAME); if(!strcmp(vardas, "0", true) ){SendClientMessage(playerid, COLOR, "* Blokuoti zaideja: /ban [dalis vardo]"); return 1;} new id = GetPlayeridMid(vardas); if (id == INVALID_PLAYER_ID){ SendClientMessage(playerid, COLOR, "* Tokio zaidejo nera"); return 1;} if (playerDB[id][admin]){ SendClientMessage(playerid, COLOR, "* Administratoriaus ismesti negalima."); return 1;} SetPVarInt(playerid, "playerid", playerid); ShowPlayerDialog(playerid, 40, DIALOG_STYLE_LIST,"Blokavimo Priezastis","Zaidima palengvinancios programos\nReklamavimas\nNepagarba\nDeathMatch\nKita","Blokuoti","Atsaukti"); return 1; }
Код:
if(dialogid == 40) { if(response) { BanEx(GetPVarInt(playerid, "playerid"), inputtext); } DeletePVar(playerid, "playerid"); return true; }
Код:
new msg[128]; format(msg,sizeof(msg),"[BAN] %s bannned player %s: (%s).",adminame,name,inputtext); SendClientMessageToAll(COLOR,msg);