AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How should look rank based on array? (https://forums.alliedmods.net/showthread.php?t=217721)

danonix 06-06-2013 14:57

How should look rank based on array?
 
Hello guys, I was wondering how to do ranks based on arrays, everything about it. I was reading code of animal mod, but it was useless. I don't know how to do it, so I'd like to ask you about it. What should I do there?
Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "xXPLUGINXx"
#define VERSION "1.0"
#define AUTHOR "xxxx"

new const FRAGS[] = {
    10,
    20,
    50,
    100,
    500,
    1000,
    8000,
    15000,
}

new const RANKING[] = {
    "Cat",
    "Dog",
    "Car",
    "Pig"
}

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
   
    register_event("DeathMsg", "eDeath", "a");
}

public eDeath(id){
    static stats[8]
    new killer = read_data(1)
   
    if(killer){
        if(stats[0] == FRAGS){ // For example 10
            client_print(id, print_chat, "Advance!");
           
            //* Set player to rank CAT
        }
    }
}



All times are GMT -4. The time now is 16:24.

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