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