Help with unknown error
#1

pawn Код:
public OnPlayerConnect(playerid)
{
    static name[25];
    GetPlayerName(playerid,name,25);
    if(!strcmp(name,"Champ",true) || !strcmp(name,"Super_Champ",true) )
    {
        static str4[128]; // max size of a mensage is 128 cell it means you can type 128 caracters, so it's not neeeded put more than the max, you would be wasting memory.
        format(str4,sizeof(str4),"[24/7] Freeraom Server Owner {B8FFFF}Champ {2AFF00}Has Connected To Server !");
        SendClientMessageToAll(COLOR_SEAGREEN,str4);
    }
    return 1;
}
It's supposed to show message if i connect to server with nick "Champ" or "Super_Champ"... but it's not working for name "Super_Champ".. If i switch the names i.e; shift name "Champ" to 2nd position and "Super_Champ" to first then i see error with Champ........ Why isn't second name position working??
Reply
#2

Change your current if statement to:
pawn Код:
if(strcmp(name,"Champ",true) == 0 && strcmp(name,"Super_Champ",true) == 0)
    {
Reply
#3

Thaaaaaaaaank you.... It worked like hell

There was just 1 mistake "&&" in code provided.. but thank you for the idea.

Reputed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)