Raised This Month: $ Target: $400
 0% 

a little help with a error


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
CipryXXX
Junior Member
Join Date: Apr 2007
Location: Romania
Old 04-12-2007 , 16:28   Re: a little help with a error
Reply With Quote #6

here is what i mayd...dunno why its not working ,i mayd a new variable : viteza and in my public speed(id) if the user buys spees then viteza =1 and in my public check(id) i am test if the user changes the weapon if viteza=1 but doesent work...some help pls.
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "CipryXXX`s Fun plugin"
#define VERSION "1.0"
#define AUTHOR "CipryXXX"

new viteza

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say /menu","Meniu")
    register_event("check","check","be")
}
public Meniu(id)
{
    new menu
    menu = menu_create ("\rCipryXXX`s Fun plugin","Meniu2")
    menu_additem(menu,"\wLife - 4000$ (addes 150HP)","1",0)
    menu_additem(menu,"\wArmour - 2000$ (addes 150 armour)","2",0)
    menu_additem(menu,"\wSpeed - 3000$ (addes extra speed)","3",0)
    menu_additem(menu,"\wGravity - 2000$ (addes extra gravity)","4",0)    
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
    menu_display(id,menu,0)
}
public Meniu2(id,menu,item)
{
    if (item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }
    else
    {
        if (!is_user_alive(id))
        {
            client_print(id, print_center, "U are dead and u can not access the menu.")
        }
        else
        {
            new buton[100],nume[100]
            new access, callback
            menu_item_getinfo(menu,item,access,buton,99,nume,99,callback)
            new tasta
            tasta = str_to_num(buton)
            switch (tasta)
            {
                case 1: life(id)
                case 2: armour(id)
                case 3: speed(id)
                case 4: gravity(id)
            }
        }
    }
    menu_destroy(menu)
    return PLUGIN_HANDLED
}
public life(id)
{
    if ( cs_get_user_money(id)< 4000)
    {
        client_print(id, print_center, "U dont have enough money to buy extra life")
    }
    else
    {
        cs_set_user_money(id,cs_get_user_money(id)-4000)
        set_user_health(id,get_user_health(id)+150)
    }
}
public armour(id)
{
    if ( cs_get_user_money(id)< 2000)
    {
        client_print(id, print_center, "U dont have enough money to buy extra armour")
    }
    else
    {
        cs_set_user_money(id,cs_get_user_money(id)-2000)
        set_user_armor(id,get_user_armor(id)+150)
    }
}
public speed(id)
{
    if ( cs_get_user_money(id)< 3000)
    {
        client_print(id, print_center, "U dont have enough money to buy extra speed")
    }
    else
    {
        viteza = 1
        cs_set_user_money(id,cs_get_user_money(id)-3000)
        set_user_maxspeed(id, 0.0)
    }
}
public gravity(id)
{
    if ( cs_get_user_money(id)< 2000)
    {
        client_print(id, print_center, "U dont have enough money to buy extra gravity")
    }
    else
    {
        cs_set_user_money(id,cs_get_user_money(id)-2000)
        set_user_gravity(id,0.5)
    }
}
public check(id)
{
    if (viteza == 1)
    {
        set_user_maxspeed(id, 0.0)
        new clip,ammo
        if (get_user_weapon(id,clip,ammo)!=CSW_KNIFE)
        {
            set_user_maxspeed(id, 0.0)
        }
        else
        {
            set_user_maxspeed(id, 0.0)
        }
    }
}

Last edited by CipryXXX; 04-12-2007 at 18:57.
CipryXXX is offline
Send a message via Yahoo to CipryXXX
 



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 06:34.


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