Raised This Month: $32 Target: $400
 8% 

[Request] inquiry about some codes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 05-01-2020 , 02:50   [Request] inquiry about some codes
Reply With Quote #1

Hello Guys...
today i have made simple Custom shop plugin for my sever But there's a problem
My problem is : when i put my plugin to test it there is some writing not showing
So can someone tell me where's the problem..


This is menu codes
PHP Code:
public cmdCustomShop(id)
{
    if ( 
is_user_alive(id) )
    {
    switch(
cs_get_user_team(id))
    {
        case 
CS_TEAM_T:
                 
CustomShopT(id);
        
        case 
CS_TEAM_CT:
            
CustomShopCt(id);
    }
         }
    else
    {
         
client_printc(id"%s You must be alive to open !gCustom Shop !nmenu!"PREFIX);
         }
}

public 
CustomShopT(id)
{         
            new 
menu menu_create ("\yGameOver\r: ^n\r.::\yCustom Shop\r::. (Zombies)""ShopT")
            
            new 
Text[32]    
            
            
formatex(Textcharsmax(Text), "\w+ 5000 Health \y[\r%d $\y]"get_pcvar_num(g_pCvarTCost[Item_Health1_T]))
            
menu_additem(menuText"1")
            
formatex(Textcharsmax(Text), "\w+ 2500 Health \y[\r%d $\y]"get_pcvar_num(g_pCvarTCost[Item_Health2_T]))
            
menu_additem(menuText"2")
            
formatex(Textcharsmax(Text), "\wSuper Gheare \y[\r%d $\y]"get_pcvar_num(g_pCvarTCost[Item_SuperKnife_T]))
            
menu_additem(menuText"3")
            
formatex(Textcharsmax(Text), "\wLow Gravity \y[\r%d $\y]"get_pcvar_num(g_pCvarTCost[Item_Gravity_T]))
            
menu_additem(menuText"4")
            
formatex(Textcharsmax(Text), "\wFast Speed \y[\r%d $\y]"get_pcvar_num(g_pCvarTCost[Item_Speed]))
            
menu_additem(menuText"5")
            
formatex(Textcharsmax(Text), "\wBunny Hop \rPermanent \y[\r%d $\y]"get_pcvar_num(g_pCvarTCost[Item_Bhop_T]))
            
menu_additem(menuText"6")
            
formatex(Textcharsmax(Text), "\wMultiJump \rPermanent \y[\r%d $\y]"get_pcvar_num(g_pCvarTCost[Item_MultiJump_T]))
            
menu_additem(menuText"7")
            
menu_setprop(menuMPROP_EXITMEXIT_ALL)
            
            
menu_display(idmenu)
            return 
PLUGIN_HANDLED;
            
}
public 
CustomShopCt(id)
{                     
            
            new 
menu menu_create ("\yGameOver\r: ^n\r.::\yCustom Shop\r::. (Builders)""ShopCt")
            
            new 
Text[32]
            
            
formatex(Textcharsmax(Text), "\w+ 255 Health \y[\r%d $\y]"get_pcvar_num(g_pCvarCTCost[Item_Health1_Ct]))
            
menu_additem(menuText"1")
            
formatex(Textcharsmax(Text), "\w+ 150 Health \y[\r%d $\y]"get_pcvar_num(g_pCvarCTCost[Item_Health2_Ct]))
            
menu_additem(menuText"2")
            
formatex(Textcharsmax(Text), "\wSuper Gheare \y[\r%d $\y]"get_pcvar_num(g_pCvarCTCost[Item_SuperKnife_Ct]))
            
menu_additem(menuText"3")
            
formatex(Textcharsmax(Text), "\wLow Gravity \y[\r%d $\y]"get_pcvar_num(g_pCvarCTCost[Item_Gravity_Ct]))
            
menu_additem(menuText"4")
            
formatex(Textcharsmax(Text), "\wM249 Para Machinegun \y[\r%d $\y]"get_pcvar_num(g_pCvarCTCost[Item_M249]))
            
menu_additem(menuText"5")
            
formatex(Textcharsmax(Text), "\wG3SG1 Auto-Sniper \y[\r%d $\y]"get_pcvar_num(g_pCvarCTCost[Item_G3SG1]))
            
menu_additem(menuText"6")
            
formatex(Textcharsmax(Text), "\wSG550 Auto-Sniper \y[\r%d $\y]"get_pcvar_num(g_pCvarCTCost[Item_SG550]))
            
menu_additem(menuText"7")
            
menu_setprop(menuMPROP_EXITMEXIT_ALL)
            
            
menu_display(idmenu)
            return 
PLUGIN_HANDLED;



ps: There's not wrong in codes, everythings is okey..
Supremache is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 05-01-2020 , 02:56   Re: [Request] inquiry about some codes
Reply With Quote #2

PHP Code:
   new Text[32
->
PHP Code:
   new Text[64
__________________
GitHub
SteamWishlist

六四天安門事件
+ARUKARI- is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 05-01-2020 , 03:33   Re: [Request] inquiry about some codes
Reply With Quote #3

Quote:
Originally Posted by +ARUKARI- View Post
PHP Code:
   new Text[32
->
PHP Code:
   new Text[64
Thanks dude
Supremache is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 05-01-2020 , 09:02   Re: [Request] inquiry about some codes
Reply With Quote #4

Quote:
+ARUKARI
I have added another codes but i got 1 wrong, and i checked a lot for the problem but i didn't fixed it , so can you tell me where is the problem
I added this :

PHP Code:
#include <amxmodx>
#include <cstrike>


new const PREFIX[] = { "!n[!gGameOver!n]" };


new 
g_pCvarCostBloodAkg_pCvarCostGoldenAkg_pCvarCostGoldenM4A1

public plugin_init()
{
    
register_plugin("My Menu""1.0""Me");
    
register_clcmd("extra_items""cmdExtraItemsShop")
    
    
    
g_pCvarCostBloodAk register_cvar("shopbb_goldenak""16000");
    
g_pCvarCostGoldenAk register_cvar("shopbb_goldenak""10000");
    
g_pCvarCostGoldenM4A1 register_cvar("shopbb_goldenm4a1""7000");
    

    
}
public 
cmdExtraItemsShop(id)
{
    if ( 
is_user_alive(id) )
    {
    switch(
cs_get_user_team(id))
    {
        case 
CS_TEAM_CT:
            
CustomShopCt(id);
    }
         }
    else
    {
         
client_printc(id"%s You must be alive to open !gCustom Shop !nmenu!"PREFIX);
         }
}

public 
CustomShopCt(id)
{
    new 
menu menu_create ("\yGameOver menu \r:^n\r.::\yExtra Items Shop\r::.(Humans)""ExtraItemsShop")
            
            new 
Text[64]
            
            
formatex(Textcharsmax(Text), "\\wBlood Ak47 \y[\r%d $\y]"get_pcvar_num(g_pCvarCostBloodAk))
            
menu_additem(menuText"1")
            
formatex(Textcharsmax(Text), "\wGolden Ak47 \y[\r%d $\y]"get_pcvar_num(g_pCvarCostGoldenAk))
            
menu_additem(menuText"2")
            
formatex(Textcharsmax(Text), "\wGolden M4a1 \y[\r%d $\y]"get_pcvar_num(g_pCvarCostGoldenM4A1))
            
menu_additem(menuText"3")
            
            
menu_setprop(menuMPROP_EXITMEXIT_ALL)
            
            
menu_display(idmenu)
            return 
PLUGIN_HANDLED;

}

public 
ExtraItemsShop(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);
    
    new 
iMoney cs_get_user_money(id);
    
    switch(
item)
    {
        case 
0:
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostBloodAk))
            {
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostBloodAk));
                
client_cmd(id"goldenshop_bloodak");
                
client_printc(id"%s You have bought !gBlood Ak!"PREFIX);
            }
            
        }
            
        case 
2
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostGoldenAk))
            {
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostGoldenAk));
                
client_cmd(id"goldenshop_goldenak");
                
client_printc(id"%s You have bought !gGolden Ak!"PREFIX);
            }
            
        }
        case 
3
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostGoldenM4A1))
            {
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostGoldenM4A1));
                
client_cmd(id"goldenshop_goldenm4");
                
client_printc(id"%s You have bought !gGolden M4A1!"PREFIX);
            }
            
        }
         }

    
menu_destroy(menu);

    return 
PLUGIN_HANDLED;
}

// Colour Chat
stock client_printc(const id, const input[], any:...)
{
    new 
count 1players[32];
    static 
msg[191];
    
vformat(msg190input3);
    
    
replace_all(msg190"!g""^x04"); // Green Color
    
replace_all(msg190"!n""^x01"); // Default Color
    
replace_all(msg190"!t""^x03"); // Team Color
    
    
if (idplayers[0] = id; else get_players(playerscount"ch");
    
    for (new 
0counti++)
    {
        if (
is_user_connected(players[i]))
        {
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);
            
write_byte(players[i]);
            
write_string(msg);
            
message_end();
        }
    }

1 Warning.
Supremache is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-01-2020 , 09:14   Re: [Request] inquiry about some codes
Reply With Quote #5

Where is the warning?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 05-01-2020 , 09:16   Re: [Request] inquiry about some codes
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
Where is the warning?
line 43
PHP Code:
new Text[64
Supremache is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-01-2020 , 09:55   Re: [Request] inquiry about some codes
Reply With Quote #7

What is the warning?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 05-01-2020 , 09:59   Re: [Request] inquiry about some codes
Reply With Quote #8

Quote:
Originally Posted by OciXCrom View Post
What is the warning?
Nothing, Thanks anyway...
I fixed it
Supremache 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:24.


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