PDA

View Full Version : Bug with SetPlayerVehicleParams (objectives)


simstosh
02/11/2012, 01:12 AM
Hi.

I'm making a script using SetPlayerVehicleParams to define the vehicle as an objective.

When I set the mark at the vehicle, everything works fine, the objective marker shows properly:
SetVehicleParamsForPlayer(PetrolObj, playerid, 1, 0);
SetVehicleParamsForPlayer(LinerunnerObj, playerid, 1, 0);

But when I try to remove the objective (set to 0), the marker doesn't disappear:
SetVehicleParamsForPlayer(PetrolObj, playerid, 0, 0);
SetVehicleParamsForPlayer(LinerunnerObj, playerid, 0, 0);

I have created a simple command to test the SetVehicleParamsForPlayer, he set the marker for the vehicles, but he doesn't remove them (1 and 2 sets and removes (in this order) for 1 vehicle, and 3 and 4 does the same for the other vehicle):
if(strcmp(cmd, "/seta", true) == 0)
{
tmp = strtok(cmdtext,idx);
new val = strval(tmp);

if(!val || val < 1 || val > 4)
{
SendClientMessage(playerid, COLOR_RED, "Faltou parametro");
return 1;
}

if(val == 1)
{
SetVehicleParamsForPlayer(PetrolObj, playerid, 1, 0);
return 1;
}
if(val == 2)
{
SetVehicleParamsForPlayer(PetrolObj, playerid, 0, 0);
return 1;
}
if(val == 3)
{
SetVehicleParamsForPlayer(LinerunnerObj, playerid, 1, 0);
return 1;
}
if(val == 4)
{
SetVehicleParamsForPlayer(LinerunnerObj, playerid, 0, 0);
return 1;
}

I tried to search in the forums about this, but haven't find any solution. Is this a bug in SA-MP or what?

Thanks.

simstosh
10/11/2012, 05:54 PM
I almost forgot this topic, but still have this problem.
Bump!