AlliedModders

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

wonsae 06-04-2006 11:08

WeapPickup event
 
The event doesn't seem to work for me I'm using TS and yes it's a event in TS
Code:
register_event("WeapPickup","weap","e") public weap(id){     ammo(id) } public ammo(id){     if(get_user_weapon(id,clip1,ammo1)){         client_print(id,print_chat,"[RealMod] You have about %i amount of ammo and %i amount of clips left",clip1,ammo1)     }     return PLUGIN_HANDLED }

This doesn't seem to work when I pick up a weapon :(

VEN 06-04-2006 12:00

Re: WeapPickup event
 
Try use a delay. For example in CS this event triggered before you got a weapon. Also you missed flag "b" for register_event, it's specified event.
Code:
register_event("WeapPickup", "weap", "be") public weap(id){     set_task(0.1, "ammo", id) } public ammo(id){     new clip1, ammo1     if (get_user_weapon(id, clip1, ammo1)) {         client_print(id, print_chat, "[RealMod] You have about %i amount of ammo and %i amount of clips left", ammo1, clip1)     }     return PLUGIN_HANDLED }

Chex 06-04-2006 17:17

Try ts_getuserwpn. I don't think get_user_weapon works in ts.

Twilight Suzuka 06-04-2006 19:00

TS doesn't use typical events. It may not use that one.


All times are GMT -4. The time now is 16:26.

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