24.01.2011, 09:19
The above code will send a message once the vehicle is streamed in, which would send the same message multiple times, once every time the player enters the area for the vehicle to be streamed. This can be done by simply removing the player from the vehicle upon entrance:
pawn Код:
public OnPlayerStateChange( playerid, newstate, oldstate )
{
if( newstate == PLAYER_STATE_DRIVER && GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 520 && !IsPlayerAdmin( playerid ) )
{
SendClientMessage( playerid, 0xFF0000FF, "Only admins can fly hydra's" );
RemovePlayerFromVehicle( playerid );
}
return 1;
}