SetVehicleParamsForPlayer Problem?
#1

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?
Reply
#2

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

Read the wiki next time before posting.
Reply
#3

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.
Reply
#4

Anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)