[solved]ts_giveweapon() 'extra' MUST be a variable
I have been running a TS server since before AMXX 1.5, and have never had a problem with ts_giveweapon ( index, weapon, clips, extra )
Now, the plugin below does not give the 'extra' part of the function. The weapon is given, with the correct amount of clips, but no silencer, flashlight, laser, or scope is added. The already approved plugin for ts_giveweapon (search the plugins) does work, meaning it adds the silencer, laser, flashlight or scope. But, it has malfunctioned more than once. For example, I tried several different values for the extra, but it kept giving a weapon with a flashlight. Besides any insights as to why 'extra' may not work, I'd appreciate some feedback on optimizing this plugin. Code: Code:
|
Re: ts_giveweapon(index,weapon,clips,extra)
Wrong section.
|
Re: ts_giveweapon(index,weapon,clips,extra)
No, it is not the wrong section. The plugin works flawlessly. I do not want any advice how to get it working -- it works. If you feel like it, tell me how to optimize it.
I want to know why extras aren't added to the guns. In previous versions of AMXX it would have worked (I am inclined to believe) because I had no problems with giving weapons via ts_giveweapon() with extras working. If not here, please tell me which section would be appropriate... |
Re: ts_giveweapon(index,weapon,clips,extra)
You can do it this way:
Code:
|
Re: ts_giveweapon(index,weapon,clips,extra)
Thanks that seems like a nice way to organize the code! It sure is a lot shorter anyways.
I have a question though. Wouldn't that code open the zombie_weapons.txt in MOTD whenever any message was sent besides something like /ruger or /deagle? That would not be any good. Too bad you didn't have any insight into why extras may not work... My tentative theory is that the 'extras' argument must be a variable. I'm going to go ahead and test that right now. |
Re: ts_giveweapon(index,weapon,clips,extra)
Yes it is in the wrong section. Post in scripting help.
|
Re: [solved] ts_giveweapon() 'extra' MUST be a variable
I really think it's worth mentioning that the 'extra' argument in ts_giveweapon(id, weapon, clips, extra) has to be a variable.
For example, Code:
However, Code:
|
| All times are GMT -4. The time now is 09:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.