AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   weapon as items (https://forums.alliedmods.net/showthread.php?t=29707)

tetsoma 06-10-2006 20:49

weapon as items
 
im useing 1.7

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <tsfun> new PLUGIN[]="WEAPONS" new AUTHOR[]="Siddhartha" new VERSION[]="2.00" public plugin_init() {      register_plugin(PLUGIN, VERSION, AUTHOR)      register_srvcmd("item_gun","item_gun") } public item_gun(id) {     new arg[32], arg2[32], arg3[32], wepid, ammo, spwnflg     read_argv(1,arg,31)     read_argv(2,arg2,31)     read_argv(3,arg3,31)        wepid = str_to_num(arg)     ammo = str_to_num(arg2)     spwnflg = str_to_num(arg3)         if(wepid == 0) {         return PLUGIN_HANDLED     }     ts_giveweapon (id,wepid,ammo,spwnflg)     return PLUGIN_HANDLED }

it compiles yes but then i try and use the item in the game it gives me

run time error 10: native error (native "ts_giveweapon")
[0] weaponasitems.sma: :item_gun ( line 32 )

Drak 06-10-2006 21:30

Try compiling it without "#include <tsxaddon>"

tetsoma 06-10-2006 21:34

same thing happened

Drak 06-10-2006 21:36

Are you trying to get the weapon ID out of the SQL DB?

tetsoma 06-10-2006 21:37

yes

like item_gun <id> "21" "88" "21"

tetsoma 06-11-2006 15:07

ok so no one can fix this

wonsae 06-11-2006 15:25

You don't need all those includes...

tetsoma 06-11-2006 15:34

i took out the useless ones and its still giving me those errors

wonsae 06-11-2006 15:44

I never said it was going to fix it, I just said it's dumb to have all those if you don't even need half of them

Charr 06-11-2006 18:05

You passed id through item_gun's header, which it is not used. You need to re-do which args are being used.


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

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