hi i'm trying to prethink attack so it honks but it doesn't seem to work
Code:
public client_PreThink(id)
{
if(incar[id] != 0)
{
new bufferstop = entity_get_int(id,EV_INT_button)
if(bufferstop != 0) {
entity_set_int(id,EV_INT_button,bufferstop & ~IN_ATTACK & ~IN_ATTACK2 & ~IN_ALT1 & ~IN_USE)
}
if((bufferstop & IN_JUMP) && (entity_get_int(id,EV_INT_flags) & ~FL_ONGROUND & ~FL_DUCKING)) {
entity_set_int(id,EV_INT_button,entity_get_int(id,EV_INT_button) & ~IN_JUMP)
}
if(get_user_button(id) &IN_ATTACK){
honk(id)
}
if(equali(carmodel[id],"car_police")){
if(get_user_button(id) &IN_ATTACK2){
siren(id)
}
}
if(get_user_button(id) &IN_JUMP){
uncar(id)
}
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
and heres the honk part
Code:
public honk(id) {
if(incar[id] != 1) return PLUGIN_HANDLED
emit_sound(id, CHAN_ITEM, "carmod/car_horn.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return PLUGIN_HANDLED
}