This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

#[WTF?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
frOOgy
Senior Member
Join Date: Jul 2014
Old 07-17-2014 , 04:43   #[WTF?
Reply With Quote #1

1. See Photo... http://www.dodaj.rs/f/p/Vb/412sQKpy/untitled.png
2. Edit problem:

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

#include <amxmodx>
#include <amxmisc>
#include <csstats>
#include <nvault>

#define PLUGIN "Rank_System"
#define VERSION "1.0"
#define AUTHOR "EaGle07"

new TotalPlayedTime[33];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /rank","cmd_rank")
}

public 
client_disconnect(id)
{
    
TotalPlayedTime[id] = TotalPlayedTime[id] + (get_user_time(id)/60);
    
SaveTime(idTotalPlayedTime[id]);
}

public 
client_putinserver(id)
{
    
TotalPlayedTime[id] = LoadTime(id);
}

public 
cmd_rank(id)

    new 
stats[8], body[8]
    
    new 
rank_pos get_user_stats(idstatsbody)
    new 
rank_max get_statsnum()
    static 
timep;
        
    
timep get_user_time(id1) / 60;
    
    static 
Deaths 0Kills 0
    
    Deaths 
stats[1], Kills stats[0], Deaths == ? (float(Kills)) : (float(Kills) / float(Deaths))
    
    new 
InfoStatus[198];
    
formatexInfoStatuscharsmaxInfoStatus ), "Rank System");
    
    new 
menu menu_createInfoStatus"rank_handler" );
    
    
formatex(InfoStatuscharsmax(InfoStatus),  "Your rank is [ %d ] of [ %d ]",rank_pos,rank_max);
    
    
menu_additemmenuInfoStatus"1");
    
    
formatex(InfoStatuscharsmax(InfoStatus),  "Kills: [ %d ] Deaths: [ %d ]",stats[0], stats[1]);
    
    
menu_additemmenuInfoStatus"2");
    
    
formatex(InfoStatuscharsmax(InfoStatus),  "Online: [ %d ] minute%s.",timep+TotalPlayedTime[id], timep == "" "s");
    
    
menu_additemmenuInfoStatus"3");
    
    
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
    
menu_displayidmenu);
    
    return 
PLUGIN_CONTINUE;
}

public 
rank_handler(idMenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(Menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
iData[6], iAccessiCallbackiName[64];
    
    
menu_item_getinfo(MenuitemiAccessiData5iName63iCallback)

    return 
PLUGIN_HANDLED;
}  
public 
LoadTimeid 
{
    new 
valut nvault_open("Time_played")
    
    new 
authip[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_ip(idauthip321);
    
    
format(vaultkey63"TIMEPLAYED%s"authip);
    
    
nvault_get(valutvaultkeyvaultdata63);
    
nvault_close(valut);
    
    return 
str_to_num(vaultdata);
}

public 
SaveTime(id,PlayedTime)
{
    new 
valut nvault_open("Time_played")
    
    if(
valut == INVALID_HANDLE)
        
set_fail_state("nValut returned invalid handle")
    
    new 
authip[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_ip(idauthip321);
    
    
format(vaultkey63"TIMEPLAYED%s"authip); 
    
format(vaultdata63"%d"PlayedTime); 
    
    
nvault_set(valutvaultkeyvaultdata);
    
nvault_close(valut);

__________________
Help me in other requests

Change Map System [PLUGIN]

GaG System [PLUGIN] [PLUGIN]

Last edited by frOOgy; 07-17-2014 at 05:47.
frOOgy is offline
Send a message via Skype™ to frOOgy
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-17-2014 , 06:08   Re: #[WTF?
Reply With Quote #2

Why are you saving by IP?
Who invented the horrible way of adding a string to a perfectly valid vault key?
__________________

Last edited by Black Rose; 07-17-2014 at 06:10.
Black Rose is offline
frOOgy
Senior Member
Join Date: Jul 2014
Old 07-17-2014 , 06:43   Re: #[WTF?
Reply With Quote #3

EaGle is autor of Rank System...
__________________
Help me in other requests

Change Map System [PLUGIN]

GaG System [PLUGIN] [PLUGIN]
frOOgy is offline
Send a message via Skype™ to frOOgy
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-17-2014 , 07:30   Re: #[WTF?
Reply With Quote #4

I don't get what is wrong

Regardless, if you are having an issue with a plugin, post in the thread where you got that plugin
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 07-17-2014 at 07:31.
YamiKaitou 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 18:23.


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