Raised This Month: $ Target: $400
 0% 

buying something [solved]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 07-24-2008 , 23:13   buying something [solved]
Reply With Quote #1

I understand this has probably been explained but trust me, I searched. Also, the funcwiki isn't too helpful because honestly it seems like you have to already know the name of the function to look it up. I am clueless about this. Hope somebody can help..

Anyways to the point, can somebody explain from the beginning (I'm a new scripter still, so I need it newb-compatible ) how to let a user buy something, for example more speed, higher damage, etc. I only need to know the buying part, not what they're buying (so like I don't need to know how to setup faster running, more dmg, etc., only the buying something part).

So yeah.. thanks again

Oh and if you can I need to know how to check if they have enough money and if they don't, send them a message and if so, make them buy whatever it is in my plugin (I won't tell yet ).

~SMITH

Last edited by PvtSmithFSSF; 07-25-2008 at 10:06. Reason: new title
PvtSmithFSSF is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 07-25-2008 , 00:23   Re: I sound like a newb.
Reply With Quote #2

Code:
public plugin_init()
{
    register_clcmd("buy_speed","SpeedBuyCommand")
}

public SpeedBuyCommand(id)
{
    new money = cs_get_user_money(id)
    if(money < 2000)
        client_print(id,print_chat,"You don't have enough money!")
    else
    {
        cs_set_user_money(id,money - 2000)
        client_print(id,print_chat,"Speed bought sucessfully!")
    }

    return PLUGIN_HANDLED
}
You can always 'crawl' the funcwiki by the modules in the initial page. You could navigate to CStrike, and you can see all the functions of the module.
danielkza is offline
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 07-25-2008 , 08:11   Re: I sound like a newb.
Reply With Quote #3

Thanks I never noticed that in funcwiki, and that code is exactly what I was looking for! TY so much
PvtSmithFSSF is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 07-25-2008 , 08:25   Re: I sound like a newb.
Reply With Quote #4

Quote:
Also, the funcwiki isn't too helpful because honestly it seems like you have to already know the name of the function to look it up.
If you just search for a keyword, E.g. speed, gravity, damage
Thats probly the easiest way to find what you want
__________________
minimiller is offline
Send a message via MSN to minimiller
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 07-25-2008 , 08:27   Re: I sound like a newb.
Reply With Quote #5

thanks
PvtSmithFSSF is offline
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 07-25-2008 , 10:02   Re: I sound like a newb.
Reply With Quote #6

How about fixing the topicname?
[X]-RayCat is offline
Reply


Thread Tools
Display Modes

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 05:40.


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