Raised This Month: $ Target: $400
 0% 

Need help whit rank plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
exelz
Member
Join Date: Oct 2006
Old 04-30-2007 , 06:25   Need help whit rank plugin
Reply With Quote #1

I am working on a rank plugin.And i need to know hou can i make like when player has made 2 kills in round then he/she will be raked to "Worker" and next round when he/she makes 4 kills in a round then he/she will be raked "Kill Miner"

And how can i make so that kills, kills needed to next rank and rank(worker...) will be shown left corner like in bf2 rank?

+KARMA ho will help me!!!

Sorry for my bad English! I am Estonian!
__________________

Last edited by exelz; 04-30-2007 at 06:29.
exelz is offline
pRED*
Join Date: Dec 2006
Old 04-30-2007 , 06:33   Re: Need help whit rank plugin
Reply With Quote #2

Download the bf2 plugin (or any other ranking plugin) and have a look.

Code:
        format(HUD, 80, "[BF2]Kills: %d/%d Badges: %d Rank: %s ",totalkills[id],nextrank[id],numofbadges[id],RANKS[g_PlayerRank[id]])         message_begin(MSG_ONE_UNRELIABLE, gmsgStatusText, {0,0,0}, id)         write_byte(0)         write_string(HUD)         message_end()

Thats the code for the Hud message (thing down the bottom) and its called on every curweapon event.

If you want to do kills in a round you could use the csstats module (get_user_rstats), or if you just want total number of kills you can also use the csstats (look it up yourself).
For total kills you have to rememebr that csstats will auto reset itself if the file gets too big. If you don't want this to happen you will need to log the kills yourself.
Register the message DeathMsg and count users kills using that.

Xp mod tutorial. - By Xuntric/Pm, definately worth a read if you havn't already..
pRED* is offline
exelz
Member
Join Date: Oct 2006
Old 04-30-2007 , 06:56   Re: Need help whit rank plugin
Reply With Quote #3

i looked the bf2rank plugin but i did not found that thing when you made 2 kills in a round then you will be a worker,...
__________________
exelz is offline
pRED*
Join Date: Dec 2006
Old 04-30-2007 , 07:03   Re: Need help whit rank plugin
Reply With Quote #4

2 kills in the same round..

Well..

register this event in plugin_init.

Code:
register_logevent("Event_Round_End", 2, "1=Round_End");

This registers the end of the round. (Time to start checking..)

Code:
public Event_Round_End() {     set_task(0.2,"badge_check_loop"); }

That makes it wait for 0.2 seconds and then start checking..

Code:
public badge_check_loop() {         new players[32],num;         get_players(players,num,"cg")     for (new counter=0; counter<num; counter++)     {         check_badges(players[counter]);     } }

That runs the check_badges function for all connected players..

Code:
public check_badges(id) {     new stats[8],wstats[8]     get_user_rstats(id,stats,wstats)     if (stats[0]>1) //More than 1 kill (0 is kills.. read the funcwiki for the rest..)     {         //Set the players rank to worker or whatever you want.             } }

Would check their kills for that round and let you do what you want with it
pRED* is offline
exelz
Member
Join Date: Oct 2006
Old 04-30-2007 , 07:19   Re: Need help whit rank plugin
Reply With Quote #5

but then how i most add ranks? set_ something was.
And can i use RANKS[g_PlayerRank[id] for adding ranks???
__________________
exelz is offline
pRED*
Join Date: Dec 2006
Old 04-30-2007 , 07:42   Re: Need help whit rank plugin
Reply With Quote #6

Read the XP tutorial plugin.
It explains basic stuff like that..
pRED* 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 06:40.


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