Raised This Month: $ Target: $400
 0% 

help with adding


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 12-29-2021 , 11:18   Re: help with adding
Reply With Quote #1

@itoxicreal; the wrong was in the line of client_print, there are two values, "Values[value] & Exps[exp]" with just one field %d also you didn't use register_plugin !

PHP Code:
client_print(idprint_chat"[CSO]  You have just received %d $ and  exp, try again after map change!"Values[value], Exps[exp]); 
PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <zp_buys>

new bool:bReward33 ]

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

enum GetReward
{
    
Value,
    
Exp
}

new 
g_szReward[ ][ GetReward ] =
{
    { 
20000200 },
    { 
35000400 },
    { 
45000600 },
    { 
50000800 },
    { 
600001000 },
    { 
1000001500 }
}

public 
plugin_init( ) 
{    
    
register_plugin"Get random reward"VERSION"Supremache" );
    
    for (new 
isizeof GET_CSOi++)
        
register_clcmdGET_CSO[i], "GetReward" );
}

public 
GetRewardid 
{
    if( 
bRewardid ] ) 
    {
        
client_printidprint_chat"[CSO] Retry again after map changes to get more Money&Exp!" );
    }
    else
    {
        new 
iValue g_szRewardrandomsizeofg_szReward ) ) ][ Value 
        new 
iExp g_szRewardrandomsizeofg_szReward ) ) ][ Exp ]
        
zp_cs_set_user_moneyidzp_cs_get_user_money(id) + iValue );
        
zp_set_user_expidzp_get_user_exp(id) + iExp );
        
client_printidprint_chat"[CSO] You have just received $%d and %d exp, try again after map change!"iValueiExp );
        
bRewardid ] = true;
    }
    return 
PLUGIN_HANDLED;

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 12-29-2021 at 16:25.
Supremache is offline
Reply



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