03.08.2014, 15:35
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new string[256];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
new vehicleid = GetPlayerVehicleID(playerid);
if(newstate & (PLAYER_STATE_DRIVER || PLAYER_STATE_PASSENGER)) //tag mismatch
{
SeatBelt[playerid] = (IsModelABike(GetPlayerVehicleID(playerid))) ? (2) : (1);
//SeatBelt[playerid] = ... Bike (2), Other Vehicle (1). So if 'SeatBelt[playerid] == 2', it means they're wearing a helmet.
}
if((newstate & PLAYER_STATE_ONFOOT) && (oldstate & (PLAYER_STATE_DRIVER || PLAYER_STATE_PASSENGER))) //tag mismatch