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

Point System


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RAW_192
Senior Member
Join Date: Feb 2017
Old 04-28-2017 , 10:06   Point System
Reply With Quote #1

Hi , I want to make an independent point system which would work totally different [ like it wont give points for kills and all ..]

I need help regarding this , have some queries

1) How can i create point.inc for it so that i would be able to use this in other plugins .. I will take the users data [ number of points he has ] to use in other plugin


Oxicrom created this for me and im working on this ..

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)
            }
        }
    }


I just need to use the points of user in more plugins ..

So how can i create point.inc ?

Last edited by RAW_192; 04-28-2017 at 10:14. Reason: Forgot to mention this
RAW_192 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 04-28-2017 , 13:04   Re: Point System
Reply With Quote #2

All those things that you said already exists on customshop.inc, take a look at it and see all natives.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-28-2017 , 13:29   Re: Point System
Reply With Quote #3

Dude... I already told you that the plugin doesn't contain the points, so it uses an .inc file for them. Simply add #include <customshop> and you can use the function cshop_give_points() anywhere.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 08:09.


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