Raised This Month: $ Target: $400
 0% 

messagemode and return value


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 01-01-2011 , 18:31   messagemode and return value
Reply With Quote #1

Hey, I wan't to make that people can enter their own value to menu... Like I've got XP buy menu like this:

PHP Code:
1. Buy 10xp
2. Buy 20xp
3. Buy 40xp
4. Buy 80xp
5. Buy 160xp
6. 
// * - and I wan't one more option where players can enter their own value... 
and then how to use it with
PHP Code:
xpCost SOMETHING_HERE 340;
client_print(idprint_chat"You bought %dxp for %d money",  SOMETHING_HERExpCost
EDIT: Also how to send that value to other public method ... please explain or link to tutorial (Searched - found nothing useful )

Last edited by reinert; 01-01-2011 at 18:34.
reinert is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-01-2011 , 18:51   Re: messagemode and return value
Reply With Quote #2

Have option 6 do client_cmd(id, "messagemode Buy_Custom_XP") then make a public function of the same name:

PHP Code:
public Buy_Custom_XP(id)
{
    new 
szArg[4]
    
read_argv(1szArgcharsmax(szArg))
    new 
iArg str_to_num(szArg)

    
// id has chosen to buy iArg XP so take their money and give them iArg XP.

__________________
fysiks is offline
Old 01-01-2011, 22:18
Elusive138
This message has been deleted by Elusive138. Reason: Never mind.
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:13.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode