Help with antihack..
#1

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..
Reply
#2

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;

Reply
#3

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.
Reply
#4

I don't know lol, was trying to help
Reply
#5

It will kick anybody.
Reply
#6

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

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

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)