12.03.2011, 13:32
Tried it like:
Not working ... but still, I would like if I could make it work OnPlayerStateChange
Still, not working.
Later edit:
Tried debugging it like:
And it didn`t print anything ... so I guess the problem is somewhere at the vehicle id?
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if( vehicleid == LSPDCar[ 11 ] )
{
if( GetPVarInt( playerid, "Faction" ) != 1 )
{
ClearAnimations( playerid );
SendClientMessage( playerid, -1, "You don`t have the keys for this car." );
}
}
return 1;
}
Still, not working.
Later edit:
Tried debugging it like:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vid = GetPlayerVehicleID( playerid );
if( vid == LSPDCar[ 11 ] )
{
print( "Debug" );
if( newstate == 2 && GetPVarInt( playerid, "Faction" ) != 1 )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, -1, "You don`t have the keys for this car." );
}
}
return 1;
}