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

check and count how many player have specific skill


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 05-29-2017 , 17:51   check and count how many player have specific skill
Reply With Quote #1

I use plugin,where all zombies get specific skills depending on how many infection made.
For the separation of these skills I use g_skill1[33], g_skill2[33], g_skill[3], g_skill[4] etc.

Is it possible to check and count how many zombies have skill2, how many skill3 etc. and show that counting to all players in hud.

Example:
[current leap zombies] [2]
[current speed zombies] [5]
[current normal zombies] [8]

Note:This is not zombie classes.I dont have zm class,just skill evolution.
Krtola is offline
Send a message via Skype™ to Krtola
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-02-2017 , 19:31   Re: check and count how many player have specific skill
Reply With Quote #2

You can use something like this to get players count of each skill.

Code:
function_test(skill) {     new players[32], pnum, id;     get_players(players, pnum);     new count;     for (--pnum; pnum >= 0; pnum--)     {         id = players[pnum];         switch (skill)         {             case 1: if (g_skill1[id]) count++;             case 2: if (g_skill2[id]) count++;             case 3: if (g_skill3[id]) count++;         }     }     return count; }

Then, you should print this with print_chat or hud_message.
__________________









Last edited by CrazY.; 06-02-2017 at 19:33.
CrazY. 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 11:06.


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