How to make only when player enter in veh and sit at driver sit to send a mesaage to him ?
#1

When a player enter in a car and sit at the driver seat, i want to server send him a message, only to the driver, not to passangers in the car !
Reply
#2

pawn Код:
public OnPlayerStateChange( playerid, newstate, oldstate )
{
    if( newstate == PLAYER_STATE_DRIVER )
    {
        // Send a message to the new driver!
    }
    return 1;
}
Reply
#3

PHP код:
public OnPlayerStateChangeplayeridnewstateoldstate )
{
    if( 
newstate == PLAYER_STATE_DRIVER )
    {
        
SendClientMessage(playeridcolor"You are the driver of this vehicle!");
    }
    return 
1;

Reply
#4

I want to do this, but only when player enter in veh ID 420
Reply
#5

pawn Код:
public OnPlayerStateChange( playerid, newstate, oldstate )
{
    if( newstate == PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(playerid) == 420)
    {
        SendClientMessage(playerid, color, "You are the driver of this vehicle!");
    }
    return 1;
}
Reply
#6

thx you
Reply
#7

Quote:
Originally Posted by Dragonsaurus
Посмотреть сообщение
pawn Код:
public OnPlayerStateChange( playerid, newstate, oldstate )
{
    if( newstate == PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(playerid) == 420)
    {
        SendClientMessage(playerid, color, "You are the driver of this vehicle!");
    }
    return 1;
}
pawn Код:
public OnPlayerStateChange( playerid, newstate, oldstate )
{
    if( newstate == PLAYER_STATE_DRIVER)
    {
        if (GetPlayerVehicleModel(GetPlayerVehicleID(playerid)) == 420)
        {
        SendClientMessage(playerid, color, "You are the driver of this vehicle!");
        }
    }
    return 1;
}
Yeah it's the same.
Reply
#8

Doesnt work
Reply
#9

Dude, he probably misspelled vehicleid and he meant modelid. How can you get vehicleid 420, you must spawn 420 vehicles to do that + 420 does match a model id. You were right about my bracket though...
Reply
#10

So, what ?I didnt understand
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)