Help Vehicles
#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


Messages In This Thread
Help Vehicles - by eblood1 - 01.12.2011, 20:56
Re: Help Vehicles - by Luis- - 01.12.2011, 21:00
Re: Help Vehicles - by eblood1 - 01.12.2011, 21:23
Re: Help Vehicles - by grand.Theft.Otto - 01.12.2011, 21:25
Re: Help Vehicles - by eblood1 - 01.12.2011, 21:31

Forum Jump:


Users browsing this thread: 2 Guest(s)