Help Vehicles -
eblood1 - 01.12.2011
why everytime i spawn a car and a player take it away from mee, then i do /v infer it teleports me on top of that player??
Re: Help Vehicles -
Luis- - 01.12.2011
What? Maybe a better explanation would do the trick.
Re: Help Vehicles -
eblood1 - 01.12.2011
Quote:
Originally Posted by -Luis
What? Maybe a better explanation would do the trick.
|
umm what exactly happens you spawn an infernus someone jacks it you spawn one again, but get teleported to the jacker?
how can i fix that?
Re: Help Vehicles -
grand.Theft.Otto - 01.12.2011
Show us your /carspawn command or whatever .
Re: Help Vehicles -
eblood1 - 01.12.2011
Quote:
Originally Posted by grand.Theft.Otto
Show us your /carspawn command or whatever .
|
umm im gonna show ya the OnPlayerExitVehicle
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
{
if(EnterV[playerid] == 1 && GetPVarInt(playerid, "VehID") != GetPlayerVehicleID(playerid))
{
DestroyVehicle(GetPVarInt(playerid, "VehID"));
SetPVarInt(playerid, "VehID", GetPlayerVehicleID(playerid));
EnterV[playerid] = 0;
}
else
EnterV[playerid] = 0;
}
if(Act[playerid] == 1)
{
if(oldstate == PLAYER_STATE_DRIVER)
{
if(newstate == PLAYER_STATE_ONFOOT)
{
if(InCar[playerid] == 1)
{
PutPlayerInVehicle(playerid, WhatCar[playerid], Driver);
}
}
}
if(oldstate == PLAYER_STATE_PASSENGER)
{
if(newstate == PLAYER_STATE_ONFOOT)
{
if(InCar[playerid] == 1)
{
PutPlayerInVehicle(playerid, WhatCar[playerid], Passanger);
}
}
}
if(oldstate == PLAYER_STATE_ONFOOT)
{
if(newstate == PLAYER_STATE_DRIVER || PLAYER_STATE_PASSENGER)
{
InCar[playerid] = 1;
WhatCar[playerid] = GetPlayerVehicleID(playerid);
}
}
}
switch(newstate)
{
case PLAYER_STATE_ONFOOT:
{
switch(oldstate)
{
case PLAYER_STATE_DRIVER: OnPlayerExitVehicle(playerid,255);
case PLAYER_STATE_PASSENGER: OnPlayerExitVehicle(playerid,255);
}
}
}
return 1;
}
#endif