Command doesn't work for me
#7

So -1 is passed in an array in the command (not some function is called in the command). Let's review the code:
pawn Код:
if (carid != -1 && Car_IsOwner(playerid, carid) || CoreVehicles[vehicleid][vehTemporary] || (PlayerData[playerid][pFaction] != -1 && CarData[carid][carFaction] == GetFactionType(playerid)) || IsAJobVehicle(vehicleid) || PlayerData[playerid][pCarKeys] == carid) // line 28644
Which are the arrays?

pawn Код:
CoreVehicles[vehicleid][vehTemporary]

PlayerData[playerid][pFaction]

CarData[carid][carFaction]

PlayerData[playerid][pCarKeys]
"playerid" cannot be an invalid so the two left are:
pawn Код:
CoreVehicles[vehicleid][vehTemporary]

CarData[carid][carFaction]
"vehicleid" will be either 0 or the vehicle ID so we exclude it as well and the one left is:
pawn Код:
CarData[carid][carFaction]
and we know that "carid" can be -1 in certain situations. Where it gets odd is that you check about the value being different than -1 so if it was an invalid, the rest shouldn't be checked at all. Can you add printf to debug it manually?
Reply


Messages In This Thread
Command doesn't work for me - by GoldenLion - 16.07.2016, 12:31
Re: Command doesn't work for me - by Stinged - 16.07.2016, 12:36
Re: Command doesn't work for me - by Konstantinos - 16.07.2016, 12:43
Re: Command doesn't work for me - by GoldenLion - 16.07.2016, 12:49
Re: Command doesn't work for me - by Konstantinos - 16.07.2016, 12:54
Re: Command doesn't work for me - by GoldenLion - 16.07.2016, 13:05
Re: Command doesn't work for me - by Konstantinos - 16.07.2016, 13:15
Re: Command doesn't work for me - by FuNkYTheGreat - 16.07.2016, 13:25
Re: Command doesn't work for me - by GoldenLion - 16.07.2016, 13:25
Re: Command doesn't work for me - by Konstantinos - 16.07.2016, 13:36

Forum Jump:


Users browsing this thread: 2 Guest(s)