Help Vehicles
#1

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

What? Maybe a better explanation would do the trick.
Reply
#3

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

Show us your /carspawn command or whatever .
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)