SA-MP Forums Archive
SetVehicleParamsForPlayer Problem? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SetVehicleParamsForPlayer Problem? (/showthread.php?tid=308365)



SetVehicleParamsForPlayer Problem? - Minion - 03.01.2012

Okay i'm trying to remove objective marker after making it. But its not working. in my system, when a player buys a car, objective marker shows where it has spawned and objective marker SHOULD disappear when player enters vehicle. I can make Marker but i cant destroy it. This is what i am writing

SetVehicleParamsForPlayer(Id,playerid,0,0);

I've tried making a command which sets objective parameter to 0 for every vehicle in game. but still it doesnt works.
btw i'm creating markers in OnVehicleStreamIn.

Any help?


Re: SetVehicleParamsForPlayer Problem? - JamesC - 03.01.2012

Note: You will have to respawn the vehicle to properly remove the objective.

Read the wiki next time before posting.


Re: SetVehicleParamsForPlayer Problem? - Minion - 03.01.2012

Quote:
Originally Posted by JamesC
Посмотреть сообщение
Okay i dont know how the hell i didnt notice that line in wiki.

Anyway, i'm not a pro scripter but i only know 1 respawning technique.

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(IsPlayerInVehicle(playerid,vID[playerid]))
{
new Float,Float:y,Float:z,Float:a;
new temp = GetVehicleModel(vID[playerid]); //vID[playerid] is id of Car
GetVehiclePos(vID[playerid],x,y,z);
GetPlayerFacingAngle(playerid,a);
DestroyVehicle(vID[playerid]);
vID[playerid] = CreateVehicle(temp,x,y,z,a,0,0,-1);
PutPlayerInVehicle(playerid,vID[playerid],0);
return 1;
}
}


This technique is noticeable so the player would get to know when car respawns. and re-creating vehicle also fixes it. Do you know any other technique of respawing vehicle without fixing it so that that original properties of vehicle stays? also, in this method theres no need of setting objective to 0. it will happen automatically.


Re: SetVehicleParamsForPlayer Problem? - Minion - 03.01.2012

Anyone?