SA-MP Forums Archive
Command by name? - 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: Command by name? (/showthread.php?tid=587163)



CLOSED. - Rodri99 - 28.08.2015

CLOSED.


Re: Command by name? - Logofero - 28.08.2015

Quote:
Originally Posted by Rodri99
Посмотреть сообщение
How to make a command for a special name player or kick automatic a player that for name has 'Rodri'?

Thanks to all,
Rodri.
PHP код:
public OnIncomingConnection(playeridip_address[], port) {
     new
          
name[MAX_PLAYER_NAME]
     ;
     
GetPlayerName(playeridnamesizeof(name));
     if (
strcmp(name"YourName"false)==0) {
         
// kick(playerid);
         
BlockIpAddress(ip_address10000); // Blocking a time 10 seconds
     
}
     return 
true;




Re: Command by name? - jlalt - 28.08.2015

PHP код:
#include a_samp
public OnPlayerConnect(playerid)
{
    new 
name[32];
    
GetPlayerName(playerid,name,sizeof(name));
    if(
strcmp(name"Rodri"true)) {
        
SendClientMessage(playerid, -1"Don't come back e.e");
        
Kick(playerid);
    }
    return 
1;