Raised This Month: $ Target: $400
 0% 

Question


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
nacho312
Member
Join Date: Mar 2020
Old 09-23-2020 , 22:17   Re: Question
Reply With Quote #5

Quote:
Originally Posted by Supremache View Post
Np, For finding that, you have to check public plugin_init() for that function had called on register_clcmd or register_concmd

This is the simple way
For Example: "The function will be "public CmdBuyAk(id)"
PHP Code:
register_clcmd("goldenshop_goldenak""CmdBuyAk")
    
register_clcmd("goldenshop_goldenak""CmdBuyAk")


public 
CmdBuyAk(id)
{
    if ( !
is_user_alive(id) )
    {
        
client_print(id,print_chat"^4[BB 6.8] To buy golden Ak 47 You need to be alive!")
        return 
PLUGIN_HANDLED
    
}
    
    new 
money cs_get_user_money(id)
    
    if (
money >= get_pcvar_num(cvar_cost))
    {
        
cs_set_user_money(idmoney get_pcvar_num(cvar_cost))
        
give_item(id"weapon_ak47")
        
g_HasAk[id] = true
    
}
    
    else
    {
        
client_print(idprint_chat"^4[BB 6.8] You dont hav enough money to buy Golden Ak 47. Cost $%d "get_pcvar_num(cvar_cost))
    }
    return 
PLUGIN_HANDLED

Ah, thank you ,and there is no other way by registring native on goldenak's sma ? I want to add this item in another menu.

Last edited by nacho312; 09-23-2020 at 22:19.
nacho312 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 13:45.


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