Quote:
Originally Posted by PrawkC
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. >.>