03.08.2014, 12:35
Okay if I'm using onplayerstate change it's working bit better but why it sends message "unbuckles his seatbelt" instead of "removes safety helmet" ??
pawn Код:
new string[256];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
new vehicleid = GetPlayerVehicleID(playerid);
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
{
if(SeatBelt[playerid] == 1)
{
if(IsModelABike(vehicleid)) // Bike - helmet
{
SeatBelt[playerid] = 0;
if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) RemovePlayerAttachedObject(playerid, helmet[0]); // Removing his helmet
if (Masked[playerid] == 1) format(string, sizeof(string), "*Stranger_%d removes the safety helmet.", maskid[playerid]);
else format(string, sizeof(string), "*%s removes the safety helmet.", sendername);
ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
return 1;
}
else // SEATBELT
{
SeatBelt[playerid] = 0;
if (Masked[playerid] == 1) format(string, sizeof(string), "*Stranger_%d unbuckles his seatbelt.", maskid[playerid]);
else format(string, sizeof(string), "*%s unbuckles his seatbelt.", sendername);
ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
}
}
}