Detecting name wont work :/
#10

Quote:
Originally Posted by Matnix
Посмотреть сообщение
pawn Код:
if(!strcmp(name(playerid),"[COD]Alex",true)) // for me it's :
// if he logging to the server and he don't have [COD]Alex (because of !strcmp)
{ //
    // send the message
    SendClientMessageToAll(COLOR,"blabla"); //
    return 1; //
} //

// try like this

if(strcmp(name,"[COD]Alex",true)) // for me it's :
// if he logging to the server and he have [COD]Alex (because of strcmp)
{ //
    // send the message
    SendClientMessageToAll(COLOR,"blabla"); //
    return 1; //
}
else // is name is not [COD]Alex
{ //
    SendClientMessageToAll(COLOR, "blabla"); //
    return 1; //
}//
correct me If I am wrong
you are wrong, if you can't compare two things then they are the same and strcmp will return 0

Quote:
Originally Posted by Alex_Obando
Посмотреть сообщение
pawn Код:
public OnPlayerSpawn(playerid)
{
   printf("OPS called %d",playerid);
   new name[256];
   new string[128];
   GetPlayerName(playerid, name, sizeof(name));
   if(PlayerSpawned[playerid] == 1)
   {
           printf("PlayerSpawned is equal to 1 %s",name);
       if(!strcmp(name,"[COD]Alex", true))
       {
           format(string, sizeof(string), "~r~Owner~w~ %s~b~(%d)~r~ has joined the server.", name,playerid);
               printf("strcmp check passed %s",string);
           GameTextForAll(string, 4000, 6);
       }
 
    }
    return 1;
}
you should add some print messages so you know exactly where it's failing
Reply


Messages In This Thread
Detecting name wont work :/ - by Alex_Obando - 28.10.2013, 01:31
Re : Detecting name wont work :/ - by Matnix - 28.10.2013, 01:41
Re: Detecting name wont work :/ - by SAMProductions - 28.10.2013, 01:45
Respuesta: Detecting name wont work :/ - by Alex_Obando - 28.10.2013, 01:47
Re: Detecting name wont work :/ - by SAMProductions - 28.10.2013, 01:51
Re : Detecting name wont work :/ - by Matnix - 28.10.2013, 01:53
Respuesta: Detecting name wont work :/ - by Alex_Obando - 28.10.2013, 01:55
Re: Detecting name wont work :/ - by EiresJason - 28.10.2013, 02:03
Re : Detecting name wont work :/ - by Matnix - 28.10.2013, 02:08
Re: Re : Detecting name wont work :/ - by cessil - 28.10.2013, 02:24

Forum Jump:


Users browsing this thread: 7 Guest(s)