"CheckOwner" not working...
#12

Quote:
Originally Posted by PrawkC
View Post
Debug your CarInfo[vehicleid][vOwner] and make sure that its set correctly
so do like

pawn Code:
public CheckOwner(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        for(new i = 1; i < sizeof(CarInfo); i++)
        {
            printf("Car %d owner %s", i, CarInfo[i][vOwner]);
            new playername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playername, sizeof(playername));
            if(!strcmp(playername, CarInfo[i][vOwner], true))
            {
                PlayerInfo[playerid][pVehicle] = 1;
                return i;
            }
            else
            {
                PlayerInfo[playerid][pVehicle] = 0;
                return i;
            }
        }
    }
    return 1;
}
Done it, and it prints out "Car 1 owner " (nothing after owner), I have a debug command as well,
pawn Code:
if(strcmp(cmd,"/vtest",true) == 0)
    {
        new pveh = PlayerInfo[playerid][pVehicle];
        format(string, sizeof(string), "Debug: %d.", pveh);
        SendClientMessage(playerid, COLOR_GREY, string);
        return 1;
    }
And I have CheckOwner(playerid); under my OnPlayerLogin call, but when I do /vtest it says it's 1, but should be 0. >.>
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: 1 Guest(s)