Admin kick problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Admin kick problem (
/showthread.php?tid=418389)
Admin kick problem -
Noles2197 - 24.02.2013
When an admin is kicking someone, it kicks the player that was typed in, but it says the admin's name..
"Administrator John Smith kicked John Smith"
Sever closed connection for Bob_Jones
Also, I need help on how to make it to where after it checks if the player ID that was entered is valid, it will also ask the administrator for the "Reason" for the kick and that will also show up on the Client message to all.
pawn Код:
stock GetName2(id){
new name[24];
GetPlayerName(id,name,sizeof(name));
strreplace(name,'_',' ');
return name;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
if(dialogid == 11) {
if(!response) return 0;
if(!IsPlayerConnected(strval(inputtext))) return ShowPlayerDialog(playerid,11,1,"Admin panel","Type in the ID of the player you wish to kick.\n{FF6347}Invalid player ID!","Submit", "Cancel");
ShowPlayerDialog(playerid,12,1,"Admin panel","Type in the reason to kick the player.","Submit", "Cancel");
new str[128],id;
format(str,sizeof(str),"%s %s kicked %s.",GetAdmin(playerid),GetName(playerid),GetName2(id));
KickMessage(strval(inputtext),str);
return 1;
}
}
Re: Admin kick problem -
Misiur - 24.02.2013
pawn Код:
GetName2(id) -> GetName2(strval(inputtext))
Re: Admin kick problem -
Noles2197 - 24.02.2013
Thanks, got it working now, but can someone help me with the reason of why the player was kicked?