What is wrong here???
Yes, Im sort of new to this whole scripting thing. But, if you could, plz tell me what is wrong.
/*AMX MOD X SCRIPT * *AWP DOGWAR * *This script makes everyone use a awp and ammo * *Version 1.0 * *Created by IseeOWNEDpeople AKA JoeCaprini */ #include <amxmodx> #include <amxmisc> ]#include <fun> public plugin_init(){ register_plugin("AWP DOGWAR","1.0","IseeOWNEDpeople") register_concmd("amx_awpwar","doggystyle",ADM IN_IMMUNITY,"1 = On 2 = Off") register_cvar("amx_awpwar","1") register_clcmd("ammo","outofmo",-1,": Gives you more ammo") } public doggystyle(id){ if(get_cvar_num("amx_awpwar") == 0){ return PLUGIN_HANDLED } if(get_cvar_num("amx_awpwar") == 1){ new clip, ammo new usersweapon = get_user_ammo(id,clip,ammo) client_cmd(id, "drop") give_item(id,weapon_awp) give_item(id,ammo_338magnum) give_item(id,ammo_338magnum) give_item(id,ammo_338magnum) } client_print(0,print_chat,"[AWPFIGHT] AWP FIGHT IS ON") } public ammo(id){ new clip, ammo new usersweapon = get_user_ammo(id,clip,ammo) give_item(id,ammo_338magnum) give_item(id,ammo_338magnum) } :cry: :cry: :cry: :cry: |
/home/users/amxmodx/tmp/3w5n8BNF.sma(29) : warning 219: local variable "ammo" shadows a variable at a preceding level
/home/users/amxmodx/tmp/3w5n8BNF.sma(30) : warning 202: number of arguments does not match definition /home/users/amxmodx/tmp/3w5n8BNF.sma(34) : error 017: undefined symbol "weapon_awp" /home/users/amxmodx/tmp/3w5n8BNF.sma(35) : error 017: undefined symbol "ammo_338magnum" /home/users/amxmodx/tmp/3w5n8BNF.sma(36) : error 017: undefined symbol "ammo_338magnum" /home/users/amxmodx/tmp/3w5n8BNF.sma(37) : error 017: undefined symbol "ammo_338magnum" /home/users/amxmodx/tmp/3w5n8BNF.sma(41) : warning 209: function "doggystyle" should return a value /home/users/amxmodx/tmp/3w5n8BNF.sma(44) : warning 219: local variable "ammo" shadows a variable at a preceding level /home/users/amxmodx/tmp/3w5n8BNF.sma(45) : warning 202: number of arguments does not match definition /home/users/amxmodx/tmp/3w5n8BNF.sma(47) : error 017: undefined symbol "ammo_338magnum" /home/users/amxmodx/tmp/3w5n8BNF.sma(48) : error 017: undefined symbol "ammo_338magnum" Out of my knowledge. My guess would be check the model to make sure its correct and you incuded the a list of models but thats just my guess. Im not too sure on this. |
FIXED IT!!!
I had to put a return PLUGIN_HANDLED in there. 8) Now it compiled
/*AMX MOD X SCRIPT * *AWP DOGWAR * *This script makes everyone use a awp and ammo * *Version 1.0 * *Created by IseeOWNEDpeople AKA JoeCaprini */ #include <amxmodx> #include <amxmisc> #include <fun> public plugin_init(){ register_plugin("AWP DOGWAR","1.0","IseeOWNEDpeople") register_concmd("amx_awpwar","doggystyle",ADM IN_IMMUNITY,"1 = On 2 = Off") register_cvar("amx_awpwar","1") register_clcmd("ammo","outofmo",-1,": Gives you more ammo") } public doggystyle(id){ if(get_cvar_num("amx_awpwar") == 0){ return PLUGIN_HANDLED } if(get_cvar_num("amx_awpwar") == 1){ client_cmd(id, "drop") give_item(id,"weapon_awp") give_item(id,"ammo_338magnum") give_item(id,"ammo_338magnum") give_item(id,"ammo_338magnum") client_print(0,print_chat,"[AWPFIGHT] AWP FIGHT IS ON") } return PLUGIN_HANDLED } public ammo(id){ give_item(id,"ammo_338magnum") give_item(id,"ammo_338magnum") } |
please use [ small][/small ]
Code:
|
I tried to make a batman script after this. Why doesn't it work???
Code:
|
Quote:
Obviously you must have some more information than it doesnt work. Does it compile? Does it give you compileing errors or warnings? Can you get it to load in game? Does it not do what you want it to? etc etc etc [Edit] at first glance it appears that you have tried to do everything at once. The admin requirments aren't set properly and you called the same cvar twice for the same purpose. If you haven't already, start from the beggining and work your way up one step at a time :wink: Code:
This works. Anyone can use it, and it is always on. First you would need to add a cvar to turn on/off. Compile it. Test it. Then add admin requirments. Compile it. Test it. That way you will know what is wrong and if you cannot solve the problem you can say "I tried to add an on/off cvar and now it doesnt work when I enter the command in game" or something similar. |
Code:
There ya go, done properly. [edit\]I should warn you though, this still will not work. You have named the client command and the cvar as the same thing and I believe you will have to choose who you are doing this to :? [/edit] The plugin written by you above (AWP War) will most likely be accessable by everyone and not just admins as you made the same mistake in that plugin. If you cannot spot the difference on your own just ask and I will point it out (but give it a good decent shot, it shouldn't be too dificult) |
Here is your code completily finished for you.
Code:
Everything works. Command: amx_batman <authid, nick, @team or #userid> |
Use Small tags when you post plugin codes. :)
|
Quote:
|
| All times are GMT -4. The time now is 14:38. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.