How to make a basic /pay command?
#5

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
@smit/wesley: He asked how to do it, not for the code. People don't learn from code, but from experience.

Simply said, retrieve the target id and the amount from the parameters, then check if the target is actually connected. If he isn't, send an error message to the player. If he is, check if the amount of money is not more than the player actually has (You can't give out $1000 if you've only got $200, for example). Same story: If the player wants to give more than he has, send an error. If not, remove that amount from the player id and give it to the target.

Now it's up to you to code it. (Please, do try and code it yourself)
Thank you for your information, I'm still learning sscanf so it's going to take me time.
Reply


Messages In This Thread
How to make a basic /pay command? - by rangerxxll - 16.10.2011, 10:02
Re: How to make a basic /pay command? - by SmiT - 16.10.2011, 10:06
Re: How to make a basic /pay command? - by Hiddos - 16.10.2011, 10:06
Re: How to make a basic /pay command? - by Wesley221 - 16.10.2011, 10:06
Re: How to make a basic /pay command? - by rangerxxll - 18.10.2011, 04:44

Forum Jump:


Users browsing this thread: 3 Guest(s)