In vehicle Message?
#1

only inside the car show message player

Код:
format(str, sizeof(str), "%s(%d) isimli araз %s(%d) tarafından tamir edildi.", vehName[GetVehicleModel(vID) - 400], vID,PlayerName, playerid);
	BilgiMesajiGonder(playerid, str);
Reply
#2

Use OnPlayerStateChange. If you were thinking of using OnPlayerEnterVehicle or OnPlayerExitVehicle...those are unreliable for doing anything to players who are STAYING in a vehicle. Since you can cancel enter/exiting a car, OnPlayerEnter/Exit is good for things like "player such and such opened your car" or something.

Anyways...

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) // Player entered a vehicle as a driver OR passenger
    {
        format(str, sizeof(str), "%s(%d) isimli araз %s(%d) tarafından tamir edildi.", vehName[GetVehicleModel(vID) - 400], vID,PlayerName, playerid);
	BilgiMesajiGonder(playerid, str);
    }
/* 
// I added this stuff below in case you want to do anything when they switch from being in a car, to being on-foot/respawning (which is another version of being on-foot)
    else if(newstate == PLAYER_STATE_ON_FOOT || newstate == PLAYER_STATE_SPAWNED)
    {
	BilgiMesajiGonder(playerid, "You are now on-foot");
    }
*/

    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)