AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Awp drop script... (https://forums.alliedmods.net/showthread.php?t=26519)

organizedKaoS 04-03-2006 19:51

Awp drop script...
 
Im trying to write a script that will drop the awp from a player when they pick it up or if they already have it. Heres what I have so far....
Code:
#include <amxmodx> #include <amxmisc> #include <engine> public plugin_init()     {     register_plugin("Awp Drop", "1.0", "KaoS")     register_event("WeapPickup", "awpDrop", "be", "1=18")     register_event("CurWeapon", "AwpDrop", "be", "1=1")     new map[32]     get_mapname(map, 31)     if(containi(map, "awp_") > -1)         {         pause("a")     } } public awpDrop(id)     {     engclient_cmd(id, "drop") } public AwpDrop(id)     {     new wpID = read_data(2)         if(wpID == CSW_AWP)         engclient_cmd(id, "drop") }
If anybody can help me thanks.

p3tsin 04-04-2006 04:34

and that doesnt work? :o
u might want to make sure its the awp that gets dropped (just in case)
Code:
engclient_cmd(id, "drop", "weapon_awp")

and u may also make the event get called only when changing to awp (or shooting with it for that matter..)
Code:
register_event("CurWeapon", "AwpDrop", "be", "1=1", "2=18")

EDIT: its maybe appropriate to remove the awp too after dropping it, take a look at this stock function http://forums.alliedmods.net/showthread.php?t=26300 :)

VEN 04-05-2006 02:47

Additionally i'd say: never do that
Code:
engclient_cmd(id, "drop")
This is a bad way which sometimes may even crash the server.
It's necessary to specify weapon to drop as p3tsin said.

organizedKaoS 04-05-2006 03:15

Thanks guys...script solved :lol: :lol: :lol:

hip_hop_x 04-14-2006 16:48

Thx
 
Thx for this code:
Code:

engclient_cmd(id, "drop", "weapon_awp")
Rezolved a part of my plugin.


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

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