Raised This Month: $51 Target: $400
 12% 

Need point system and its API


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RAW_192
Senior Member
Join Date: Feb 2017
Old 04-20-2017 , 16:27   Need point system and its API
Reply With Quote #1

I need a point system API , Where points would be given to players for joining server every 24 hours ..

Like if i join today i get +5 points , if i join tomorrow i get +10 points and so on .
RAW_192 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-21-2017 , 12:54   Re: Need point system and its API
Reply With Quote #2

You forgot to mention that you need it for this plugin.

PHP Code:
#include <amxmodx>
#include <customshop>
#include <nvault>

#define POINTS_PER_DAY 5

new g_iVaultg_szAuthId[33][35]

public 
plugin_init()
{
    
register_plugin("CSHOP Addon: 24h Login Bonus""1.0""OciXCrom")
    
g_iVault nvault_open("CSHOPLogin")
}

public 
plugin_end()
    
nvault_close(g_iVault)
    
public 
client_putinserver(id)
{
    
get_user_authid(idg_szAuthId[id], charsmax(g_szAuthId[]))
    
use_vault(id1)
}

public 
client_disconnect(id)
    
use_vault(id0)

use_vault(idiType)
{
    switch(
iType)
    {
        case 
0:
        {
            new 
szTime[20]
            
num_to_str(get_systime(), szTimecharsmax(szTime))
            
nvault_set(g_iVaultg_szAuthId[id], szTime)
        }
        case 
1:
        {
            new 
iGet nvault_get(g_iVaultg_szAuthId[id])
            
            if(!
iGet || (iGet get_systime() >= 86400))
            {
                new 
szName[32]
                
get_user_name(idszNamecharsmax(szName))
                
cshop_give_points(idPOINTS_PER_DAY)
                
client_print(0print_chat"* %s got %i points for daily login."szNamePOINTS_PER_DAY)
            }
        }
    }

__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
loiraolhosazul
Member
Join Date: May 2020
Old 10-27-2020 , 04:41   Re: Need point system and its API
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
You forgot to mention that you need it for this plugin.

PHP Code:
#include <amxmodx>
#include <customshop>
#include <nvault>

#define POINTS_PER_DAY 5

new g_iVaultg_szAuthId[33][35]

public 
plugin_init()
{
    
register_plugin("CSHOP Addon: 24h Login Bonus""1.0""OciXCrom")
    
g_iVault nvault_open("CSHOPLogin")
}

public 
plugin_end()
    
nvault_close(g_iVault)
    
public 
client_putinserver(id)
{
    
get_user_authid(idg_szAuthId[id], charsmax(g_szAuthId[]))
    
use_vault(id1)
}

public 
client_disconnect(id)
    
use_vault(id0)

use_vault(idiType)
{
    switch(
iType)
    {
        case 
0:
        {
            new 
szTime[20]
            
num_to_str(get_systime(), szTimecharsmax(szTime))
            
nvault_set(g_iVaultg_szAuthId[id], szTime)
        }
        case 
1:
        {
            new 
iGet nvault_get(g_iVaultg_szAuthId[id])
            
            if(!
iGet || (iGet get_systime() >= 86400))
            {
                new 
szName[32]
                
get_user_name(idszNamecharsmax(szName))
                
cshop_give_points(idPOINTS_PER_DAY)
                
client_print(0print_chat"* %s got %i points for daily login."szNamePOINTS_PER_DAY)
            }
        }
    }

how to improve this system ?,
example

day 1 = 10 points
day 2 = 20 points,
etc..

if the user enters every day he will win normally, more if he stays a day without entering resets for day 1.
Has as ?
loiraolhosazul 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 16:16.


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