AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need help whit rank plugin (https://forums.alliedmods.net/showthread.php?t=54623)

exelz 04-30-2007 06:25

Need help whit rank plugin
 
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!:|

pRED* 04-30-2007 06:33

Re: Need help whit rank plugin
 
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..

exelz 04-30-2007 06:56

Re: Need help whit rank plugin
 
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,...

pRED* 04-30-2007 07:03

Re: Need help whit rank plugin
 
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

exelz 04-30-2007 07:19

Re: Need help whit rank plugin
 
but then how i most add ranks? set_ something was.
And can i use RANKS[g_PlayerRank[id] for adding ranks???

pRED* 04-30-2007 07:42

Re: Need help whit rank plugin
 
Read the XP tutorial plugin.
It explains basic stuff like that..


All times are GMT -4. The time now is 06:40.

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