Dumb Question..
Hey, I'm just starting to poke around with AMXX code.. only really good with C++.. which makes me feel like an idiot right now (not being able to find where the error is..)
But with the ts_giveweapon function in tsfun.inc.. I keep getting a type mismatch. Code:
/* Plugin generated by AMXX-Studio */ |
Re: Dumb Question..
Well for one I think you need to include tsx if I'm not mistaken. Two have a multi-array with these:
enum { TSW_GLOCK18 = 1, TSW_UNK1, TSW_UZI, TSW_M3, TSW_M4A1, TSW_MP5SD, TSW_MP5K, TSW_ABERETTAS, TSW_MK23, TSW_AMK23, TSW_USAS, TSW_DEAGLE, TSW_AK47, TSW_57, TSW_AUG, TSW_AUZI, TSW_TMP, TSW_M82A1, TSW_MP7, TSW_SPAS, TSW_GCOLTS, TSW_GLOCK20, TSW_UMP, TSW_M61GRENADE, TSW_CKNIFE, TSW_MOSSBERG, TSW_M16A4, TSW_MK1, TSW_C4, TSW_A57, TSW_RBULL, TSW_M60E3, TSW_SAWED_OFF, TSW_KATANA, TSW_SKNIFE, TSW_KUNG_FU, TSW_TKNIFE, } and then have something like: new clips, extra, weapon = blah blah ts_giveweapon(id,weapon,clips,extra ) |
Re: Dumb Question..
I included TSX and I set the variables to be something but it still gives me an argument mismatch on the first variable.
|
Re: Dumb Question..
It looks like you're passing in index (a string - username?) when you want id (an integer - player slot on server?)
You need a cmd_target() or find_player() first, then pass the output of that into the give_weapon function |
Re: Dumb Question..
Yeah that makes sense. Looking at some other code I realized that it was player id, not name. I'll try that out and let you know how it went.
|
Re: Dumb Question..
I did the cmd_target(id, index, 15) and then it gave me a type mismatch on the second. I tried str_to_num(weapon) but it still gives me a mismatch...
Edit: I just made variables like weapon_num for the str_to_num function.. it compiles but no .amxx file is made. Edit2: Nevermind, got it. Thanks everyone - I'm gonna go test this! |
Re: Dumb Question..
I don't really get cmd_target() to be perfectly honest, so I'd use find_player instead.
It also looks like all of the arguments should be integers. I don't know if you can pass in a value as str_to_num, so I'll just make 4 new variables - what the hell. Code:
|
| All times are GMT -4. The time now is 21:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.