Quote:
Originally Posted by Supremache
He has to use amx_addban , because amx_ban or amx_banip etc can't ban the player when he has disconnected so use amx_addban, also can use another method like creating a variable to save the player when disconnected from the server and check when the player tries to connect to the server again
|
I just tried it myself, it does work with amx_ban. I tried without server_exec(), it didn't work.
server_cmd() doesn't guarantee that the command is executed immediately, server_exec() has to be called in order to immediately execute whatever is inside server_cmd(). If it's not used, then the player will be fully disconnected and it will be too late to get his info.
PHP Code:
public client_disconnect(id)
{
server_cmd("amx_ban #%d 5 test", get_user_userid(id))
server_exec();
}
Try it with and without server_exec() and see the difference