Raised This Month: $51 Target: $400
 12% 

How to set money


Post New Thread Reply   
 
Thread Tools Display Modes
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 03-18-2019 , 13:19   Re: How to set money
Reply With Quote #11

thanks
Mikaeel123 is offline
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 03-19-2019 , 10:59   Re: How to set money
Reply With Quote #12

Check if the client has enough money to buy an item using
Code:
cs_get_user_money(client)
and if that condition is true then apply the item and subtract from the client's money using
Code:
cs_set_user_money(client, blabla)
else just print them a message telling them they don't have sufficient funds.

Or

If you want to do it more professionally, if the condition is satisfied add an item and if it's not add the same item but grey it out if that makes sense making it inaccessible from the menu. When it's grey let it show the menu again and return 0 when clicked.

Or

Deal with callbacks which I hate.

Last edited by Moody92; 03-19-2019 at 11:06.
Moody92 is offline
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 03-20-2019 , 12:15   Re: How to set money
Reply With Quote #13

i want to know what the place of the this code ??? in this place ??
Quote:
{
case 0: client_cmd(id, "tornado");
case 1: client_cmd(id, "say /link");

}
Or this
Quote:
{
menu_cancel(id);
return PLUGIN_HANDLED;
}
Or this ?
Quote:
{
new menu = menu_create("PubLic Menu :", "MohammadHlwani");

menu_additem(menu, "\r[\yTorNado\r]", "", 0); // case 0
menu_additem(menu, "\r[\yFazaIi\r]", "", 0); // case 1

menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);

menu_display(id, menu, 0);

return PLUGIN_HANDLED;
}
i know the place is in the 1st but i use like this . its not worked !
Quote:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <csx>

public plugin_init()
{
register_plugin("My Menu", "1.0", "Me");
register_clcmd("say /vmenu", "ShowMenu");
register_clcmd("say /vmenu", "ShowMenu");
register_concmd("say /vmenu", "ShowMenu" , ADMIN_RESERVATION );

}

public ShowMenu(id)
{
new menu = menu_create("PubLic Menu By @Thew_ConFIger :", "MohammadHlwani");

menu_additem(menu, "\r[\yTorNado\r] \r[\y10000\r]" , "" , 1); // case 0
menu_additem(menu, "\r[\yNaboDGar\r] \r[\y16000\r]" , "" , 1); // case 1

menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);

menu_display(id, menu, 0);

return PLUGIN_HANDLED;
}

public MohammadHlwani(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_cancel(id);
return PLUGIN_HANDLED;
}

new command[6], name[64], access, callback;

menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);

switch(item)
{
case 0: client_cmd(id, "tornado");
case 0: cs_set_user_money(target, cs_get_user_money(target) - 10000);
case 1: client_cmd(id, "say /link");
case 1: cs_set_user_money(target, cs_get_user_money(target) - 10000);
}


menu_destroy(menu);

return PLUGIN_HANDLED;
}
How do that ???

i know the code but dont know how use ?
Mikaeel123 is offline
thEsp
BANNED
Join Date: Aug 2017
Old 03-20-2019 , 14:53   Re: How to set money
Reply With Quote #14

Post a new thread, it is totally free !!! Didn't you know?
thEsp is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 03-20-2019 , 16:27   Re: How to set money
Reply With Quote #15

Quote:
{
case 0: client_cmd(id, "tornado");
case 1: client_cmd(id, "say /link");

}
__________________








CrazY. is offline
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 03-21-2019 , 01:59   Re: How to set money
Reply With Quote #16

Quote:
Originally Posted by Mikaeel123 View Post
i want to know what the place of the this code ??? in this place ??

Or this

Or this ?


i know the place is in the 1st but i use like this . its not worked !

How do that ???

i know the code but dont know how use ?
You see, problem is, clients will still be able to type tornado in console and get the item for free.

Only way it's possible to set a cost is through the plugins that contain these items. Only then this menu would be possible.

I suggest posting a new thread in Suggestions/Requests forum with the item plugins that you want to set a cost to.

Last edited by Moody92; 03-21-2019 at 02:07.
Moody92 is offline
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 04:47.


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