SA-MP Forums Archive
Help with antihack.. - 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: Help with antihack.. (/showthread.php?tid=592552)



Help with antihack.. - itachi - 26.10.2015

Please I play on my server and same player connect,teleport with me and my nick kicked and he have my nick...
and play for me...
please help me with antihack for thefts nick..


Re: Help with antihack.. - Karan007 - 26.10.2015

Hello ,
i've created this but it's untested don't know if it will work but still try it :d

PHP код:
new name[MAX_PLAYERS];

public 
OnPlayerConnect(playerid)
{
    
GetPlayerName(playeridnamesizeof(name));
    if(
name == name) return Kick(playerid);
    return 
1;




Re: Help with antihack.. - J0sh... - 26.10.2015

Quote:
Originally Posted by Karan007
Посмотреть сообщение
Hello ,
i've created this but it's untested don't know if it will work but still try it :d

PHP код:
new name[MAX_PLAYERS];
public 
OnPlayerConnect(playerid)
{
    
GetPlayerName(playeridnamesizeof(name));
    if(
name == name) return Kick(playerid);
    return 
1;

What the hell is that code what will it fix like jesus.


Re: Help with antihack.. - Karan007 - 26.10.2015

I don't know lol, was trying to help


Re: Help with antihack.. - J0sh... - 26.10.2015

It will kick anybody.


Re: Help with antihack.. - SecretBoss - 26.10.2015

Well you must loop the players and check if the name already exists


AW: Help with antihack.. - Kaliber - 26.10.2015

Like this:

PHP код:
static stock CheckMultipleName(const name[])
{
    new 
bool:x,i=GetPlayerPoolSize()+1,n[MAX_PLAYER_NAME];
    for(; --
i!=-1;)
    {
        if(!
GetPlayerName(i,n,MAX_PLAYER_NAME)) continue;
        if(!
strcmp(n,name,true))
        {
            if(
x) return 1;
            
x=true;
        }
    }
    return 
0;
}
//Then OnPlayerConnect or somewhere else:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
if(
CheckMultipleName(name))
{
    return 
Kick(playerid); //Here the name was multiple found