SA-MP Forums Archive
How to make only when player enter in veh and sit at driver sit to send a mesaage to him ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to make only when player enter in veh and sit at driver sit to send a mesaage to him ? (/showthread.php?tid=459769)



How to make only when player enter in veh and sit at driver sit to send a mesaage to him ? - bustern - 24.08.2013

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 !


Re: How to make only when player enter in veh and sit at driver sit to send a mesaage to him ? - Konstantinos - 24.08.2013

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



Re: How to make only when player enter in veh and sit at driver sit to send a mesaage to him ? - xXSPRITEXx - 24.08.2013

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




Re: How to make only when player enter in veh and sit at driver sit to send a mesaage to him ? - bustern - 26.08.2013

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


Re: How to make only when player enter in veh and sit at driver sit to send a mesaage to him ? - Dragonsaurus - 26.08.2013

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;
}



Re: How to make only when player enter in veh and sit at driver sit to send a mesaage to him ? - bustern - 26.08.2013

thx you


Re: How to make only when player enter in veh and sit at driver sit to send a mesaage to him ? - ProjectMan - 26.08.2013

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.


Re: How to make only when player enter in veh and sit at driver sit to send a mesaage to him ? - bustern - 26.08.2013

Doesnt work


Re: How to make only when player enter in veh and sit at driver sit to send a mesaage to him ? - Dragonsaurus - 26.08.2013

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...


Re: How to make only when player enter in veh and sit at driver sit to send a mesaage to him ? - bustern - 27.08.2013

So, what ?I didnt understand