Thread: Question
View Single Post
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