A RemovePlayerFromVehicle akkor nem mûködik, mikor még csak száll be a jármûbe.
ClearAnimations:
public OnPlayerEnterVehicle( playerid, vehicleid, ispassenger )
{
if( GetVehicleModel(vehicleid) == 598 )
{
if(pi[playerid][admin] >= 1 || pi[playerid][rendor] >= 1)
{
}else { ClearAnimations(playerid);}
}
if( GetVehicleModel(vehicleid) == 599 )
{
if(pi[playerid][admin] >= 1 || pi[playerid][rendor] >= 1)
{
}else {ClearAnimations(playerid);}
}
if( GetVehicleModel(vehicleid) == 416 )
{
if(pi[playerid][admin] >= 1 || pi[playerid][mento] >= 1)
{
}else {ClearAnimations(playerid);}
}
return 1;
}
vagy OnPlayerStateChange-nél a RemovePlayerFromVehicle
public OnPlayerStateChange( playerid, newstate, oldstate )
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if( GetVehicleModel(vehicleid) == 598 )
{
if(pi[playerid][admin] >= 1 || pi[playerid][rendor] >= 1)
{
}else { RemovePlayerFromVehicle(playerid);}
}
if( GetVehicleModel(vehicleid) == 599 )
{
if(pi[playerid][admin] >= 1 || pi[playerid][rendor] >= 1)
{
}else {RemovePlayerFromVehicle(playerid);}
}
if( GetVehicleModel(vehicleid) == 416 )
{
if(pi[playerid][admin] >= 1 || pi[playerid][mento] >= 1)
{
}else {RemovePlayerFromVehicle(playerid);}
}
}
return 1;
}
Ja és vehicleid helyett GetVehicleModel(vehicleid) kell, de ha mondjuk az 599-es ID helyett egy változót használsz, aminek az értéke egy jármû, akkor úgy kell használd, hogy if(vehicleid == valtozo).