06.09.2014, 23:11
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_HORN && GetPlayerVehicleID(playerid) == VEHICLE_BULLET && IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
if(!HORN_ACTIVATED[GetPlayerVehicleID[playerid]) {
// Place the attach object code here.
HORN_ACTIVATED[vehicleid] = 1;
// stream the audio here maybe
return true;
}
else {
HORN_ACTIVATED[vehicleid] = 0;
// Detach the object/stop the stream etc.
return true;
}
}
}