Remove ammo problem
hi,
i'm kind of new to all of this and id really like to learn from the experts, heres my problem, i'm trying to write a simple plugin that will remove the ammo of a user but for some reason it doesn't remove the ammo and gives a run time error, i know you can just drop the weapon but i dont want them to drop the weapon just have no ammo heres my code (appologies if the code is badly done :? ), Code:
amx returns the error Code:
can anyone tell me what i'm doing wrong thanks in advance Xcalibar |
check your amxx.cfg to see if your debug settings are set right. I have very little experience with weapons and ammo, so I am not going to waste your time guessing what is right.
// Plugin Debug mode // 0 - No debugging (garbage line numbers) // 1 - Plugins with "debug" option in plugins.ini are put into debug mode // 2 - All plugins are put in debug mode // Note - debug mode will affect JIT performance amx_debug 1 |
Re: Remove ammo problem
i'm newb at this as well but i think you got the return part wrong and you need to check if user is alive try this
Code:
amx returns the error Code:
and i apoligise if im completley wrong as like i said im newb too. but i hope that works or helps. also may want to look up the user alive funtion. |
You aren't passing a player id to steal_ammo .
|
thanks for all the replys,
i changed the code to this Code:
however i now get the following error Code:
i have also set amx_debug to "2" thanks in advance Xcalibar |
Code:
|
thanks Black Rose for the reply
however it still returns the same error as before Code:
thanks in advanced Xcalibar |
Do not confuse cs_*_weapon_* natives with cs_*_user_* natives.
For example: native cs_get_user_deaths(index) uses player's index. native cs_get_weapon_id(index) uses weapon's entity index. If you dont know what is weapon's entity index you shouldn't use such natives. |
Thanks for all the replys so far,
i'm still having trouble with this i did manage to get past the runtime error but run into another problem, it doesn't seem to remove the ammo? heres what i've got, Code:
thanks in advance xcalibar |
I think you didn't listen, reread what i said in the previous post.
|
| All times are GMT -4. The time now is 16:38. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.