25.08.2011, 08:06
So here's my code..
It's meant to check if the playersname matches the one in the enum, however, even though the playersname isn't the same as the one in the enum, it still sets it as 1 (when it's meant to set it as 0 if it's not), please help!
pawn Code:
public CheckOwner(playerid)
{
if(IsPlayerConnected(playerid))
{
for(new i = 1; i < sizeof(CarInfo); i++)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
if(strcmp(playername,CarInfo[i][vOwner],true)==0)
{
PlayerInfo[playerid][pVehicle] = 1;
return i;
}
else if(strcmp(playername,CarInfo[i][vOwner],false)==0)
{
PlayerInfo[playerid][pVehicle] = 0;
return i;
}
}
}
return 1;
}