AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   prethink (https://forums.alliedmods.net/showthread.php?t=27840)

wonsae 04-30-2006 19:44

prethink
 
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 }

karlos 04-30-2006 21:43

Code:

if(bufferstop != 0) {
            entity_set_int(id,EV_INT_button,bufferstop & ~IN_ATTACK & ~IN_ATTACK2 & ~IN_ALT1 & ~IN_USE)
        }

here you are removing attack, attack2 and 2 more so
Code:

if(get_user_button(id) &IN_ATTACK)
and
Code:

if(get_user_button(id) &IN_ATTACK2)
is always false


All times are GMT -4. The time now is 05:06.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.