AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   buying something [solved] (https://forums.alliedmods.net/showthread.php?t=74783)

PvtSmithFSSF 07-24-2008 23:13

buying something [solved]
 
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 :D ) 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 :P ).

~SMITH

danielkza 07-25-2008 00:23

Re: I sound like a newb.
 
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.

PvtSmithFSSF 07-25-2008 08:11

Re: I sound like a newb.
 
Thanks I never noticed that in funcwiki, and that code is exactly what I was looking for! TY so much :)

minimiller 07-25-2008 08:25

Re: I sound like a newb.
 
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

PvtSmithFSSF 07-25-2008 08:27

Re: I sound like a newb.
 
thanks :D

[X]-RayCat 07-25-2008 10:02

Re: I sound like a newb.
 
How about fixing the topicname?


All times are GMT -4. The time now is 05:40.

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