[mysql] What's wrong with this CMD ?
#7

Strings can't be compared with the '==' equal operator. You need to use strcmp (string compare)

https://sampwiki.blast.hk/wiki/Strcmp

Apart from that, the loop wouldn't work either:

Do something like this:

pawn Код:
new player = INVALID_PLAYER_ID;
foreach(new i : Player)
{
    GetPlayerName(i, name, sizeof(name))
    if(strcmp(name, nom, true) == 0)
    {
        player = i;
        break;
    }
}
if(player != INVALID_PLAYER_ID) //means that a player was found
{
    //code
}
else //no player was found online with that name
{
   //code
}
Use 'player' instead of 'nom', because you've stored the player id to handle in that variable.
Reply


Messages In This Thread
[mysql] What's wrong with this CMD ? - by anou1 - 16.02.2014, 17:11
Re: [mysql] What's wrong with this CMD ? - by anou1 - 16.02.2014, 20:14
Re: [mysql] What's wrong with this CMD ? - by CuervO - 17.02.2014, 01:25
Re: [mysql] What's wrong with this CMD ? - by anou1 - 17.02.2014, 01:31
Re: [mysql] What's wrong with this CMD ? - by CuervO - 17.02.2014, 01:33
Re: [mysql] What's wrong with this CMD ? - by anou1 - 17.02.2014, 01:36
Re: [mysql] What's wrong with this CMD ? - by CuervO - 17.02.2014, 01:40
Re: [mysql] What's wrong with this CMD ? - by anou1 - 17.02.2014, 02:01
Re: [mysql] What's wrong with this CMD ? - by CuervO - 17.02.2014, 02:04
Re: [mysql] What's wrong with this CMD ? - by anou1 - 17.02.2014, 02:25

Forum Jump:


Users browsing this thread: 1 Guest(s)