Raised This Month: $ Target: $400
 0% 

ammo/money for staying active


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-20-2021 , 10:31   Re: ammo/money for staying active
Reply With Quote #3

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <zombieplague>

#define PLUGIN "[ZP] PlayTime Ammopacks reward"
#define VERSION "1.0"
#define AUTHOR "Natsheh"

#if AMXX_VERSION_NUM > 182
#define client_disconnect client_disconnected
#endif

new g_cvar_leng_cvar_amount;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
g_cvar_len register_cvar("zp_playtime_reward_length""10");
    
g_cvar_amount register_cvar("zp_playtime_reward_amount""50");
}

public 
client_putinserver(id)
{
    
    
set_task(floatmax(get_pcvar_float(g_cvar_len), 1.0) * 60.0 "reward_player"id__"b");
}

public 
client_disconnect(id)
{
    
remove_task(id);
}

public 
reward_player(id)
{
    new 
iReward get_pcvar_num(g_cvar_amount);
    
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + iReward);
    
client_print(idprint_chat"You've been rewarded %d ammopacks for playing an extra %d minutes on the server!"iRewardmax(get_pcvar_num(g_cvar_len), 1));

here's my best if bugsy is interested to optimize it be my guest
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 03-20-2021 at 10:39.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
 



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 19:50.


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