AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [Rankying System] (https://forums.alliedmods.net/showthread.php?t=244106)

frOOgy 07-13-2014 19:10

[Rankying System]
 
I need plugins rankying system for cs 1.6. When player say: /rank then player can see menu:
[Rank System]:
1. Rank: %d of %s
2. Kills: %d | Deaths: %s
3. Online: %d

When player press any of 1, 2 or 3 button then menu closed.

Eagle07 07-13-2014 21:54

Re: [Rankying System]
 
1 Attachment(s)
Tested & worked
--
http://www.shy22.com/upfilpng/p7m02821.png
--

frOOgy 07-13-2014 22:29

Re: [Rankying System]
 
TH Brother soo much!

indraraj striker 07-14-2014 09:12

Re: [Rankying System]
 
Quote:

Originally Posted by Eagle07 (Post 2167246)


eagle07 can you set task for menu only 10 sec
after 10 sec it will erase !!

Flick3rR 07-14-2014 10:55

Re: [Rankying System]
 
1 Attachment(s)
Eagle, why you open the vault on each player connect or disconnect. Waste of CPU. Just make it global, open it in plugin_init and close it in plugin_end.
And why (the hell?!) are you using player's IP as a key. It could be easily changed, you need the steamID instead.
Why you even get the info from the menu? Just destroy it in the handler no matter which option did the player use.
You don't need to format the vault data with formatex, since there is only one integer to save in (PlayedTime). Use num_to_str instead.
You also have some redundant lines with static Kills and Deaths, which you don't use anywhere.
I have fixed these little mistakes, here is the code.
Btw, it's disappearing after 10 seconds. If you don't want to, just remove these lines:
PHP Code:

set_task(10.0/*This is the time*/"CancelMenu"id)

/*......*/

public CancelMenu(id)
    if(
is_user_connected(id))
        
client_cmd(id"slot1"


HamletEagle 07-14-2014 12:31

Re: [Rankying System]
 
Flicker didn't "fixed" everything.

1.
PHP Code:

if(gVault == INVALID_HANDLE)
        
set_fail_state("nVault returned invalid handle"

Put this in plugin_init, you don't need to waste server resources every time when a player disconnect.

2. Use formatex instead of format.

Flick3rR 07-14-2014 14:06

Re: [Rankying System]
 
Didn't notice that. Let the OP have it on his mind, I'm not able to upload the new code now.


All times are GMT -4. The time now is 15:14.

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