SA-MP Forums Archive
How to detect my 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: How to detect my name (/showthread.php?tid=372312)



How to detect my name - [D]ry[D]esert - 26.08.2012

Hello Every one , i was wondering how to make when i joined my server or my friend say Wb or kick or anything else
like this:
pawn Код:
public OnPlayerConnect(playerid)
{
    new pName[MAX_PLAYER_NAME],ppName[MAX_PLAYERS];
    ppName[playerid] = GetPlayerName(playerid,pName,sizeof(pName));
    if(ppName[playerid] == Hero )
    {
    Kick(playerid);
    }
    return 1;
}
Errors Show:
pawn Код:
error 017: undefined symbol "Hero"



Re: How to detect my name - Avi57 - 26.08.2012

Here you Go :
pawn Код:
public OnPlayerConnect(playerid)
{
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s has joined the server. Welcome!",pName);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}



Re: How to detect my name - leonardo1434 - 26.08.2012

pawn Код:
public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    if(strcmp(name,"nameofyourfrined",false))
    {
       Kick(playerid);
    }
    return 1;
}



Re: How to detect my name - [D]ry[D]esert - 26.08.2012

Quote:
Originally Posted by Avi57
Посмотреть сообщение
Here you Go :
pawn Код:
public OnPlayerConnect(playerid)
{
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s has joined the server. Welcome!",pName);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}
Nah,i didnt mean this.
Thanks for fast replay.and i ment this:
pawn Код:
new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    if(!strcmp(name, "[D]ry[D]esert"))
    {
    Kick(playerid);
    }



Re: How to detect my name - Akira297 - 26.08.2012

<removed>


Re: How to detect my name - [D]ry[D]esert - 26.08.2012

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
pawn Код:
public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    if(strcmp(name,"nameofyourfrined",false))
    {
       Kick(playerid);
    }
    return 1;
}
That what i ment, already solved it but Thanks