Raised This Month: $ Target: $400
 0% 

help with adding


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
itoxicreal
Senior Member
Join Date: Jun 2018
Old 12-26-2021 , 16:26   help with adding
Reply With Quote #1

Hey can anyone help me add
zp_cs_set_user_money(id, zp_cs_get_user_money(id) + Values[value]);
zp_set_user_exp(id, zp_get_user_exp(id) + Exps[exp]);
in 1 line?

and edit the client print msg

client_print(id, print_chat, "[ZP] You have just received %d $ and %d exp, try again after map change!", Values[value]);


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

new bool:g_HasMoneynEXP[33] = false;

new const 
GET_CSO[][] = {
    
    
"say /get",
    
"say_team /get"
}

new 
Values[6] = {

    
20000
    
35000,
    
45000,
    
50000,
    
60000,
    
100000
}
new 
Exps[6] = {

    
200
    
400,
    
600,
    
800,
    
1000,
    
1500
}

public 
plugin_init() {    
    
register_cvar("cso_get"VERSIONFCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED)

    for (new 
isizeof GET_CSOi++)
    
register_clcmd(GET_CSO[i], "give_money_exp");
}

public 
plugin_natives()
{
    
register_native("zp_cs_get_user_money""_get_money"1)
    
register_native("zp_cs_set_user_money""native_set_money"1)
    
register_native("zp_get_user_exp""native_get_exp"1)
    
register_native("zp_set_user_exp""native_set_exp"1)
}

public 
give_money_exp(id) {
    
    if(
g_HasMoneynEXP[id]) {
        
client_print(idprint_chat"[CSO] Retry again after map changes to get more Money&Exp!");
        return 
PLUGIN_HANDLED;
    }
    
    new 
value random_num(20000100000)
    new 
exp random_num(2001500)
    
zp_cs_set_user_money(idzp_cs_get_user_money(id) + Values[value]);
    
zp_set_user_exp(idzp_get_user_exp(id) + Exps[exp]);
    
client_print(idprint_chat"[CSO]  You have just received %d $ and  exp, try again after map change!"Values[value], Exps[exp]);
    
g_HasMoneynEXP[id] = true;
    
    return 
PLUGIN_HANDLED;

itoxicreal 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 11:30.


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