Raised This Month: $ Target: $400
 0% 

shopmenu help :- /


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
dixo1
Junior Member
Join Date: Jun 2008
Old 09-29-2009 , 10:39   shopmenu help :- /
Reply With Quote #1

This is the code i come up with so far:

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <engine>

#define PLUGIN "SuperLiga-Shopmenu"
#define VERSION "1.1"
#define AUTHOR "KoGeRbArNeT"

 public plugin_init()
 {
    register_plugin(PLUGIN, VERSION, AUTHOR)

    register_clcmd("say /shopmenu","shopmenu")
    register_clcmd("say shopmenu","shopmenu")
 }
 public shopmenu(id)
 {
    new menu = menu_create("\rShopmenu:", "menu_handler");

    menu_additem(menu, "\w+25 hp - 2000", "1", 0);
    menu_additem(menu, "\wSpeed up - 2000", "2", 0);
    menu_additem(menu, "\wGravity - 2000", "5", 0);
    menu_additem(menu, "\wRevive - 8500", "3", 0);
    menu_additem(menu, "\w16 xp - 16000", "4", 0);

    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);

    menu_display(id, menu, 0);
 }
 public menu_handler(id, menu, item)
 {
    if( item == MENU_EXIT )
    {
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }

    new data[6], iName[64];
    new access, callback;
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);


    new key = str_to_num(data);

    switch(key)
    {
        case 1:
        {
        new money = cs_get_user_money(id)
            if(money>=1999){
                    cs_set_user_money(id, money -2000);
                    
                    client_print(id, print_chat, "You bought hp!");
            
                    new hp = get_user_health(id);
                    set_user_health(id , hp +25); 
                        }
            menu_destroy(menu);
            return PLUGIN_HANDLED;
        }
        case 2:
        {
        new money = cs_get_user_money(id)
            if(money>=1999){
                    cs_set_user_money(id, money -2000);
                    
                    client_print(id, print_chat, "You bought speed!");
            
                    new Float:speed = get_user_maxspeed(id);
                    set_user_maxspeed(id , speed +100);
                           }
        }
        case 3:
        {
          new money = cs_get_user_money(id)
            if(money>=8499){
                    cs_set_user_money(id, money -8500);
                    
                    client_print(id, print_chat, "You bought retrive!");
                    
                    //Make the engine think he is spawning
                    set_pev(id,pev_deadflag,DEAD_RESPAWNABLE);
                    set_pev(id, pev_iuser1, 0);
                    dllfunc(DLLFunc_Think,id)

                    //Move his body so if corpse is created it is not in map
                    engfunc(EngFunc_SetOrigin,id,Float:{-4800.0,-4800.0,-4800.0})

                    //Actual Spawn
                    set_task(0.5,"respawn",id)
                           }
        }
        case 4:
        {
           new money = cs_get_user_money(id)
            if(money>=8499){
                    cs_set_user_money(id, money -8500);
                    client_print(id, print_chat, "You bought 16 xp!");
                           }
        }
        case 5:
        {
           new money = cs_get_user_money(id)
            if(money>=8499){
                    cs_set_user_money(id, money -8500);
                    client_print(id, print_chat, "You bought gravity!");
                           }
        }
    }

    menu_destroy(menu);
    return PLUGIN_HANDLED;
 }
 public respawn(id)
{
        spawn(id)
        dllfunc(DLLFunc_Spawn,id)
}


I would like to ask how i get the respawn thing towork.
And if anyone could help me make the gravity thing and so speed dosnt go away after chaning weapon or getting shooted at then it would be great!
dixo1 is offline
 



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


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