01.12.2011, 21:31
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
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