AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   messagemode and return value (https://forums.alliedmods.net/showthread.php?t=146831)

reinert 01-01-2011 18:31

messagemode and return value
 
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 )

fysiks 01-01-2011 18:51

Re: messagemode and return value
 
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.




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

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