Arguments not finishing
1 Attachment(s)
Sorry for the name, It's very hard to make into a topic name.
My goal for this plugin: To allow players to transfer Experience (XP) between themselves but only allow a percentage of transferable XP. Example: Player A has 10,000 XP and wants to give player B 100 XP. Percentage of usable XP is 10% so Player A transfers 10,000 XP so that player B receives the 100 XP. My problem(s): When a name is passed via "/transferxp <name> <amount>" the plugin does not do anything, but when NOTHING is called but saying "/transferxp" it gives all the debug statements I included in the code. Here is a picture for better reference of all info. shown from JUST typing "/transferxp": [IMG]http://img126.**************/img126/4367/csitaly0000fv9.th.png[/IMG] Note: the info. you cannot see is that of my debug statements inside the code. It says the SERVER is receiving the XP when I provide NO parameters. My idea: For player A (Bill) to give XP to player B (John) by typing "/transferxp John 10000" using the regular "say" function. My code: Code:
/* Plugin generated by AMXX-Studio */Slmclarengt |
Re: Arguments not finishing
I rewrote it since your code is basically unworkable (at least to me). There's no real way to detect 10% of their XP, so I just left that part out:
Code:
Problems: 1) You can give more XP than you have. 2) You can't cap it at 10% (as I said before). This is more an example than anything - you could integrate it into your WC3 plugin (I'm guessing FT) to give the ability to check the XP of these players. |
Re: Arguments not finishing
How can you not get 10 percent of a number? There are plenty of ways...
One being: Code:
(My math may be a little off [and code for that matter], I'm half asleep :-) ) |
Re: Arguments not finishing
Quote:
|
Re: Arguments not finishing
'scuse me :p.
|
Re: Arguments not finishing
Quote:
Slmclarengt |
Re: Arguments not finishing
Well I'm saying that there's no way to extract the amount of XP someone has from WC3FT, thus you cannot derive 10% of their XP.
If you want to modify the WC3FT source code itself, it would be pretty easy (I think there's a global variable called g_PlayerXP or something like that). |
Re: Arguments not finishing
Ok, I'm saying take 10% of the TRANSFERRED XP so 10% of 100 XP to TRANSFER would be 10. Also, this plugin does not work :-). I was testing it on my server and if any arguments are passed (to transfer xp), the xp does not do anything, but the part of code that catches when no arguments are passed works fine. It does give the "You must transfer more than 0 xp (entered 0)" if I just type "/transferxp" without any arguments, but if I type "/transferxp hawk552 2000" it does nothing and says nothing.
Slmclarengt |
Re: Arguments not finishing
Try simplifying it into 3 args instead of the 6 that I did, it's just in case your name is like "bob bill smith" and the person types each one without quotes.
|
Re: Arguments not finishing
Quote:
Code:
#include <amxmodx> |
| All times are GMT -4. The time now is 00:36. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.