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

[ANY] Time Point System


Post New Thread Reply   
 
Thread Tools Display Modes
Author
hlsavior
Junior Member
Join Date: Sep 2012
Plugin ID:
3327
Plugin Version:
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Unapprover:
    Reason for Unapproving:
    No plugin
    Old 10-26-2012 , 17:38   [ANY] Time Point System
    Reply With Quote #1

    This doesn't use any Cvars, if its installed its enabled.


    • Every 5 minutes points go up by 1
    • To edit the amount of times to increase a point edit this line:
    Code:
    ClientTimer[client] = CreateTimer(300.0, TimerAddPoints, client, TIMER_REPEAT);
    • If you change that I also suggest you change the message that appears every ten minutes:
    Code:
    ClientTimer[client] = CreateTimer(600.0, TenMinutes, client, TIMER_REPEAT);
    And...
    Code:
    PrintToChat(client, "\x03You've been on for \x06ten\x03 minutes and earned \x06%d\x03 more points!", 2);
    • Users can type !points or sm_points in console to view the amount of points they have.
    • This plugin also comes with an announcement to, well, announce when someone joins the server and how many times they've joined before.
    • This Plugin creates a file when loaded in "cstrike/addons/sourcemod/data/stats/playerinfo.txt" where all the points and connect times are saved.
    Screen Shots:









    Last edited by BAILOPAN; 10-30-2012 at 20:05. Reason: (removed binary)
    hlsavior is offline
    ecca
    Sexy Santa
    Join Date: Jan 2011
    Old 10-26-2012 , 18:37   Re: [ANY] Time Point System
    Reply With Quote #2

    You should add cvars, not everyone has the experience how to recompile a plugin.

    Also

    PHP Code:
    public Action:Command_getPoints(clientargs)
    {
        new 
    String:Name[32];
        
    GetClientName(clientNamesizeof(Name));
        
    PrintToChatAll("\x04%s\x01 has \x04%d\x01 points."NamePoints[client])
        return 
    Plugin_Handled;

    TO

    PHP Code:
    public Action:Command_getPoints(clientargs)
    {
        
    PrintToChatAll("\x04%N\x01 has \x04%d\x01 points."clientPoints[client])
        return 
    Plugin_Handled;

    ecca is offline
    hlsavior
    Junior Member
    Join Date: Sep 2012
    Old 10-26-2012 , 20:33   Re: [ANY] Time Point System
    Reply With Quote #3

    So I know the basics of sourcepawn which is how I made this, I also know how to make convars but I dont know how to make a ConVar kill the plugin. So far I've tried this:

    PHP Code:
    public OnPluginStart()
    {
        
        
    h_Enabled CreateConVar("sm_timepoints_enabled""1""Is time points enabled? 1 = yes, 0 = no.  Defualt = 1"FCVAR_NOTIFY|FCVAR_DONTRECORD); 
        
        new 
    IsEnabled GetConVarInt(h_Enabled);
        if(
    IsEnabled == 0)
        {
            
    EndPlugin();
        }
        
        
    CreateDirectory("addons/sourcemod/data/stats"3);
        
    BuildPath(Path_SMKVPathsizeof(KVPath), "data/stats/playerinfo.txt");
        
    RegConsoleCmd("sm_points"Command_getPoints"");

    Then later in the code:

    PHP Code:
    public Action:EndPlugin()
    {
           return 
    Plugin_Handled;

    There's probably something very clear and obvious that I'm doing wrong, but I just started.

    Last edited by hlsavior; 10-26-2012 at 21:03. Reason: Helpo
    hlsavior is offline
    Skyy
    AlliedModders Donor
    Join Date: Jan 2010
    Location: Toronto, Canada
    Old 10-27-2012 , 07:01   Re: [ANY] Time Point System
    Reply With Quote #4

    Code:
    public OnPluginStart()
    {
        ...
        if (GetConVarInt(h_Enabled) == 0) return;
    }

    If you send it to its own function (EndPlugin()) the return value affects only that function.
    Just do it directly in OnPluginStart()
    Code:
    if (GetConVarInt(h_Enabled) == 0) EndPlugin();
    
    stock EndPlugin() { return Plugin_Handled; }
    Allow flexibility in config file:
    Code:
    new Handle:f_ClientAddPoints;
    f_ClientAddPoints = CreateConVar("cvar_name","300.0","Number of seconds between point distributions.");
    ClientTimer[client] = CreateTimer(GetConVarFloat(f_ClientAddPoints), TimerAddPoints, client, TIMER_REPEAT);

    Last edited by Skyy; 10-27-2012 at 07:05.
    Skyy is offline
    noctua
    Member
    Join Date: Dec 2010
    Old 10-30-2012 , 12:25   Re: [ANY] Time Point System
    Reply With Quote #5

    Would be useful if you can use these points.

    Like:
    100p = low grav for 1hours
    10p = reserved slot for a day

    something like that
    noctua is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 10-30-2012 , 20:02   Re: [ANY] Time Point System
    Reply With Quote #6

    You need to attach the source to the main thread and not a compiled binary.

    EDIT:
    From looking at the disassembly, you may want to add convars instead of hard coding everything. As well to this, you may want to watch the language you place into the plugin. Something questionable, like "ni**a please" isn't really appropriate.

    Last edited by KyleS; 10-30-2012 at 20:13.
    KyleS is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 10-30-2012 , 20:55   Re: [ANY] Time Point System
    Reply With Quote #7

    You also need to review the rules.
    Particularly the part that says:
    • Do not disrupt the readability of a thread with huge lengths of texts, wild color/font variations, or large images (this includes making the main body of all your posts a different font/color/style).
    This includes text that is Much Larger than it needs to be.

    __________________
    DarthNinja is offline
    crilleaz
    Member
    Join Date: Oct 2010
    Old 11-10-2012 , 16:38   Re: [ANY] Time Point System
    Reply With Quote #8

    I want this, looks awesome, put the files here again.
    crilleaz is offline
    deltadude
    SourceMod Donor
    Join Date: Mar 2010
    Old 11-14-2012 , 06:33   Re: [ANY] Time Point System
    Reply With Quote #9

    i too would like to see this.
    __________________
    deltadude is offline
    Skyy
    AlliedModders Donor
    Join Date: Jan 2010
    Location: Toronto, Canada
    Old 11-14-2012 , 06:41   Re: [ANY] Time Point System
    Reply With Quote #10

    Yes, but is the purpose in the points?
    Skyy is offline
    Reply


    Thread Tools
    Display Modes

    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:57.


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