"CheckOwner" not working...
#1

So here's my code..
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;
}
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!
Reply


Messages In This Thread
"CheckOwner" not working... - by Jack_Leslie - 25.08.2011, 08:06
Re: "CheckOwner" not working... - by PrawkC - 25.08.2011, 08:38
Re: "CheckOwner" not working... - by Jack_Leslie - 25.08.2011, 08:38
Re: "CheckOwner" not working... - by Emmet_ - 25.08.2011, 08:39
Re: "CheckOwner" not working... - by PrawkC - 25.08.2011, 08:41
Re: "CheckOwner" not working... - by Jack_Leslie - 25.08.2011, 08:42
Re: "CheckOwner" not working... - by jameskmonger - 25.08.2011, 08:46
Re: "CheckOwner" not working... - by Jack_Leslie - 25.08.2011, 08:47
Re: "CheckOwner" not working... - by PrawkC - 25.08.2011, 08:51
Re: "CheckOwner" not working... - by Jack_Leslie - 25.08.2011, 08:59
Re: "CheckOwner" not working... - by PrawkC - 25.08.2011, 09:04
Re: "CheckOwner" not working... - by Jack_Leslie - 25.08.2011, 09:09
Re: "CheckOwner" not working... - by PrawkC - 25.08.2011, 09:13
Re: "CheckOwner" not working... - by Jack_Leslie - 25.08.2011, 09:18
Re: "CheckOwner" not working... - by jameskmonger - 25.08.2011, 09:28

Forum Jump:


Users browsing this thread: 4 Guest(s)