Raised This Month: $ Target: $400
 0% 

Solved Help ban with server_cmd()


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
zXCaptainXz
Member
Join Date: May 2017
Old 04-17-2022 , 16:24   Re: Help ban with server_cmd()
Reply With Quote #6

Quote:
Originally Posted by Supremache View Post
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

Last edited by zXCaptainXz; 04-17-2022 at 16:25. Reason: Added example
zXCaptainXz is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode