AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help with editing sma plugin file (prokreedz) (https://forums.alliedmods.net/showthread.php?t=46886)

berix 11-04-2006 15:20

help with editing sma plugin file (prokreedz)
 
Hi All,
I’m a Head Admin on two CS Server, one of them is jumping ‘kz’ server. I use “prokreedz” plugin which gives me possibility to save position, then load it, it counts time of jumping etc. But original version isn’t very convenient and that’s why I decided to change it, by doing few upgrades, but… My conception of the way it looks is far beyond my skills with AMXX Mod programming language, that’s why I write here and ask you for help.

So:
  • I changed the way of showing information about finishing map and time. Original was print_center now it’s show_hudmessage – this park works very well.
  • I also changed showing actual time, now it’s eg. 2 min 30 sec, but it did not look nice so I once again changed print_center by show_hudmessage, but now there’s a problem: if clock that shows actual time in white font in upper part of screen is enabled ( option in menu) and then somebody finish the map, there is a notification that he has finished map but it disappear after 1 second (or even less). But if the clock is disabled notification works fine and it’s on the screen for 4 second just the way it should. Here is my question: How to repair that ? I thought maybe if I cut lines that are responsible for displaying the time and create separate plugin that would do it, because I know if both messages are displayed from two separate plugins into show_hudmessage then one doesn’t interrupt the other. But which lines shall I cut and how to do such a plugin… It’s far beyond my knowledge… Or maybe some other ideas for solving that?
  • Another problem is with showing the time: Prokreedz shows it as
-[ 2 minutes 3 seconds ]
-Player has finished map in 2:3
The way I’d like it to be is:
-[ 2 minutes 03 seconds ]
-Player has finished map in 2:03
  • Next thing is about checkpoints (saving current position on map): I’d like to change it a bit and if player save checkpoint, his time is incrementing by 5seconds. Is it possible in this plugin?
I also give you the .sma file form prokreedz plugin.
I ask you all for help and I’m looking forward for answer from you.
(And one more: sorry for my English :D)

This is modificked prokreedz *.sma
Code:


#include <amxmodx>
#include <amxmisc>
#include <fun>                // For some Adminstuff
#include <engine>            // My most used module ;o
#include <cstrike>            // I need this to give somebody a nvg :(
#include <nvault>            // For top10

#define MAX_CPS 5            // MUST be greater than 2
#define NOBLOCK_DISTANCE 120.0        // Distance between 2 players - if distance is smaller -> semiclip
#define CP_DISTANCE 35.0        // Distance between player and checkpoint
#define KZ_LEVEL ADMIN_KICK        // Adminlevel
#define BUTTON_DISTANCE 70.0        // Distance between timer button and player

#define MENU_KEYS MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_0
#define MENU_KEYS_ADMIN MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0

new bool:noblock[32]

new Float:checkpoints[32][MAX_CPS][3]
new checkpointnum[32]

new bool:needhelp[32]
new helpcount[32]

new bool:timer_started[32]
new timer_time[32]
new bool:showtimer[32]

new bhop[32]

new bool:usedbutton[32]

new bool:firstspawn[32]

// CVars (I like CVar pointers :o)
new kz_checkpoints
new kz_godmode
new kz_scout
new kz_help
new kz_semiclip
new kz_bhop
new kz_adminglow
new kz_cheatdetect
new kz_transparency

// Sprites
new Sbeam = 0

// =================================================================================================

public plugin_init() {
    register_plugin("ProKreedz","1.0","p4ddY")
   
    register_cvar("prokreedz_version","1.0",FCVAR_SERVER)
   
    // CVars
    kz_checkpoints = register_cvar("kz_checkpoints","1")
    kz_godmode = register_cvar("kz_godmode","1")
    kz_scout = register_cvar("kz_scout","1")
    kz_help = register_cvar("kz_help","0")
    kz_semiclip = register_cvar("kz_semiclip","1")
    kz_bhop = register_cvar("kz_bhop","0")
    kz_adminglow = register_cvar("kz_adminglow","0")
    kz_cheatdetect = register_cvar("kz_cheatdetect","1")
    kz_transparency = register_cvar("kz_transparency","1")
   
    // Cmds
    register_clcmd("say .kreedz","kz_menu")
    register_clcmd("say /kreedz","kz_menu")
    register_clcmd("say .menu","kz_menu")
    register_clcmd("say /menu","kz_menu")
   
    register_clcmd("cp","checkpoint")
    register_clcmd("checkpoint","checkpoint")
    register_clcmd("say .cp","checkpoint")
    register_clcmd("say /cp","checkpoint")
    register_clcmd("say .checkpoint","checkpoint")
    register_clcmd("say /checkpoint","checkpoint")
   
    register_clcmd("tp","goto_checkpoint")
    register_clcmd("gocheck","goto_checkpoint")
    register_clcmd("say","goto_checkpoint_say")
   
    register_clcmd("stuck","goto_stuck")
    register_clcmd("unstuck","goto_stuck")
    register_clcmd("say .stuck","goto_stuck")
    register_clcmd("say /stuck","goto_stuck")
    register_clcmd("say .unstuck","goto_stuck")
    register_clcmd("say /unstuck","goto_stuck")
   
    register_clcmd("say .help","help")
    register_clcmd("say /help","help")
   
    register_clcmd("say .reset","reset_checkpoints")
    register_clcmd("say /reset","reset_checkpoints")
   
    register_clcmd("kz_unhelp","admin_unhelp",KZ_LEVEL)
    register_clcmd("kz_showhelp","admin_showhelp",KZ_LEVEL)
    register_clcmd("say .noclip","admin_noclip",KZ_LEVEL)
    register_clcmd("say /noclip","admin_noclip",KZ_LEVEL)
    register_clcmd("kz_laser","admin_laser",KZ_LEVEL,"[blue|yellow|green|red|orange]")
   
    // Some other admincmds
    register_clcmd("kz_noclip","admin_noclip",KZ_LEVEL,"<name|#userid|steamid|@ALL> <on/off>")
    register_clcmd("kz_teleport","admin_teleport",KZ_LEVEL,"<name|#userid|steamid> <name|#userid|steamid>")
    register_clcmd("kz_gravity","admin_gravity",KZ_LEVEL,"<name|#userid|steamid|@ALL> <gravity>")
   
    register_clcmd("say .amenu","kz_menu_admin_show",ADMIN_CVAR)
    register_clcmd("say /amenu","kz_menu_admin_show",ADMIN_CVAR)
    register_clcmd("say .adminmenu","kz_menu_admin_show",ADMIN_CVAR)
    register_clcmd("say /adminmenu","kz_menu_admin_show",ADMIN_CVAR)
   
    register_clcmd("say .respawn","respawn")
    register_clcmd("say /respawn","respawn")
    register_clcmd("say .spawn","respawn")
    register_clcmd("say /spawn","respawn")
    register_clcmd("say .start","respawn")
    register_clcmd("say /start","respawn")
   
    register_clcmd("say .top10","topten_show")
    register_clcmd("say /top10","topten_show")
    register_clcmd("say .top15","topten_show")
    register_clcmd("say /top15","topten_show")
   
    // Events
    register_event("DeathMsg","deathmsg","a")
    register_event("ResetHUD","resethud","be")
    //register_touch("player","func_button","button_touch") SUCKS!
   
    // Menue
    register_menu("ProKreedz by p4ddY",MENU_KEYS,"menu_handler")
    register_menu("Adminmenu",MENU_KEYS_ADMIN,"menu_handler_admin")
   
    set_task(0.1,"noblock_task",1000,"",0,"ab")
    set_task(1.0,"timer_task",2000,"",0,"ab")
   
    new kreedz_cfg[128], cfgdir[64]
       
    get_configsdir(cfgdir,64)   
    format(kreedz_cfg,128,"%s/kreedz.cfg",cfgdir)
       
    if(file_exists(kreedz_cfg)) {
        server_exec()
        server_cmd("exec %s",kreedz_cfg)
    }
}

public plugin_precache() {
    Sbeam = precache_model("sprites/laserbeam.spr")
}

// =================================================================================================
// Global Functions
// =================================================================================================

public respawn(id) {
    new pid = id < 100 ? id : id-100
    spawn(pid)
}

// IF YOU USE THIS FOR YOUR OWN PLUGIN, PLEASE CREDIT ME! thanks
public noblock_task() {
    if(get_pcvar_num(kz_semiclip) > -1) {
        new bool:solid[32]
        new Float:origin[3]
        new Float:vorigin[3]
        for(new x=1;x<=get_maxplayers();x++) {
            if(is_user_connected(x) && is_user_alive(x)) {
                if(get_pcvar_num(kz_semiclip) == 1 || noblock[x-1]) {
                    entity_get_vector(x,EV_VEC_origin,origin)
                    for(new i=1;i<=get_maxplayers();i++) {
                        if(x != i && is_user_connected(i) && is_user_alive(i)) {
                            entity_get_vector(i,EV_VEC_origin,vorigin)
                            if(get_distance_f(origin,vorigin) <= NOBLOCK_DISTANCE) {
                                entity_set_int(x,EV_INT_solid,SOLID_NOT)
                                entity_set_int(i,EV_INT_solid,SOLID_NOT)
                               
                                if(get_pcvar_num(kz_transparency) == 1) {
                                    set_rendering(x,kRenderFxNone,255,255,255,kRenderTransAdd,60)
                                    set_rendering(i,kRenderFxNone,255,255,255,kRenderTransAdd,60)
                                }
                               
                                solid[x-1] = true
                                solid[i-1] = true
                            }
                            else if(!solid[i-1]) {
                                entity_set_int(i,EV_INT_solid,SOLID_BBOX)
                                glow(i)
                            }
                        }
                    }
                }
                else if(!solid[x-1]) {
                    entity_set_int(x,EV_INT_solid,SOLID_BBOX)
                    glow(x)
                }
            }
        }
    }
    else {
        for(new i=1;i<=get_maxplayers();i++) {
            if(is_user_connected(i) && is_user_alive(i)) {
                entity_set_int(i,EV_INT_solid,SOLID_BBOX)
                glow(i)
            }
        }
    }
}

// =================================================================================================

public timer_task() {
    for(new i=1;i<=get_maxplayers();i++) {
        if(is_user_connected(i) && is_user_alive(i) && showtimer[i-1] && timer_started[i-1]) {
            new kreedztime = get_systime() - timer_time[i-1], imin
            if((kreedztime / 60.0) >= 1) {
                imin = floatround(kreedztime / 60.0,floatround_floor)
                kreedztime -= (floatround(kreedztime / 60.0,floatround_floor) * 60)
            }
            client_print(i,print_center,"[ %d minut%s %d sekund%s ]",imin,imin == 1 ? "" : "s",kreedztime,kreedztime == 1 ? "" : "s")
            }
    }
}

// =================================================================================================

public glow(id) {
    new colors[3]
    if(needhelp[id-1] && get_pcvar_num(kz_help) == 1)
        colors = {255,0,0}
    else if(access(id,KZ_LEVEL) && get_pcvar_num(kz_adminglow) == 1)
        colors = {170,255,0}
    else
        colors = {0,0,0}
       
    set_rendering(id,kRenderFxGlowShell,colors[0],colors[1],colors[2],kRenderNormal,25)
}

// =================================================================================================

public detect_cheat(id,reason[]) { // I saw this feature in kz_mulitplugin :o
    if(timer_started[id-1] && get_pcvar_num(kz_cheatdetect) == 1) {
        client_print(id,print_chat,"[STI CS 1.6 Server KZ] Wykryto %s - Timer wyzerowany",reason)
        timer_started[id-1] = false
    }
}

// =================================================================================================
// Cmds
// =================================================================================================

public checkpoint(id) {
    if(get_pcvar_num(kz_checkpoints) == 1) {
        if(is_user_alive(id)) {
            if(entity_get_int(id,EV_INT_flags)&FL_DUCKING) {
                client_print(id,print_chat,"[STI CS 1.6 Server KZ] Nie mozna zapisac checkpointa w sklonie")
                return PLUGIN_HANDLED
            }
           
            for(new i=MAX_CPS-1;i>0;i--) {
                checkpoints[id-1][i][0] = checkpoints[id-1][i-1][0]
                checkpoints[id-1][i][1] = checkpoints[id-1][i-1][1]
                checkpoints[id-1][i][2] = checkpoints[id-1][i-1][2]
            }
            new Float:origin[3]
            entity_get_vector(id,EV_VEC_origin,origin)
            checkpoints[id-1][0][0] = origin[0]
            checkpoints[id-1][0][1] = origin[1]
            checkpoints[id-1][0][2] = origin[2]
           
            if(checkpointnum[id-1] > 0)
                client_print(id,print_chat,"[STI CS 1.6 Server KZ] Checkpoint nr. %d zapisany, dystans od poprzedniego: %dm",checkpointnum[id-1]+1,floatround(get_distance_f(checkpoints[id-1][1],origin) / 20,floatround_round))
            else
                client_print(id,print_chat,"[STI CS 1.6 Server KZ] Pierwszy Checkpoint zapisany")
            checkpointnum[id-1]++
        }
        else
            client_print(id,print_chat,"[STI CS 1.6 Server KZ] Musisz uczestniczyc w grze by urzyc tej funkcji")
    }
    else
        client_print(id,print_chat,"[STI CS 1.6 Server KZ] Checkpointy wylaczone")
   
    return PLUGIN_HANDLED
}

// =================================================================================================

public goto_checkpoint(id) {
    if(get_pcvar_num(kz_checkpoints) == 1) {
        if(is_user_alive(id)) {
            if(checkpointnum[id-1] > 0) {
                if(read_argc() == 2) {
                    new szcp[8], cpnum
                    read_argv(1,szcp,8)
                    cpnum = str_to_num(szcp) - 1
                       
                    if(cpnum >= 0 && cpnum < MAX_CPS) {
                        if(cpnum < checkpointnum[id-1])
                            goto_cp(id,cpnum)
                        else
                            client_print(id,print_chat,"[STI CS 1.6 Server KZ] You have not created enough checkpoints")
                    }
                    else
                        goto_cp(id,0)
                }
                else {
                    goto_cp(id,0)
                }
            }
            else
                client_print(id,print_chat,"[STI CS 1.6 Server KZ] Wpierw zapisz pozycje - Checkpoint")
        }
        else
            client_print(id,print_chat,"[STI CS 1.6 Server KZ] Musisz zyc by urzyc tej funkcji")
    }
    else
        client_print(id,print_chat,"[STI CS 1.6 Server KZ] Checkpointy wylaczone")
       
    return PLUGIN_HANDLED
}

public goto_checkpoint_say(id) {
    if(read_argc() == 2) {
        new szarg1[32], args1[16], args2[16]
        read_argv(1,szarg1,32)
        copyc(args1,16,szarg1,32)
        copy(args2,16,szarg1[strlen(args1)+1])
        if(equal(args1,".tp") || equal(args1,"/tp") || equal(args1,".gocheck") || equal(args1,"/gocheck")) {
            if(get_pcvar_num(kz_checkpoints) == 1) {
                if(is_user_alive(id)) {
                    if(checkpointnum[id-1] > 0) {
                        new cpnum = str_to_num(args2) - 1
                        if(cpnum >= 0 && cpnum < MAX_CPS) {
                            if(cpnum < checkpointnum[id-1])
                                goto_cp(id,cpnum)
                            else
                                client_print(id,print_chat,"[STI CS 1.6 Server KZ] You have not created enough checkpoints")
                        }
                        else
                            goto_cp(id,0)   
                    }
                    else
                        client_print(id,print_chat,"[STI CS 1.6 Server KZ] Wpierw zapisz pozycje - Checkpoint")
                }
                else
                    client_print(id,print_chat,"[STI CS 1.6 Server KZ] Musisz uczestniczyc w grze by urzyc tej funkcji")
            }
            else
                client_print(id,print_chat,"[STI CS 1.6 Server KZ] Checkpointy wylaczone")
               
            return PLUGIN_HANDLED
        }
    }
   
    return PLUGIN_CONTINUE
}

public goto_stuck(id) {
    if(get_pcvar_num(kz_checkpoints) == 1) {
        if(is_user_alive(id)) {
            if(checkpointnum[id-1] > 1)
                goto_cp(id,1)
            else
                client_print(id,print_chat,"[STI CS 1.6 Server KZ] You have not created enough checkpoints")
        }
        else
            client_print(id,print_chat,"[STI CS 1.6 Server KZ] Musisz uczestniczyc w grze by urzyc tej funkcji")
    }
    else
        client_print(id,print_chat,"[STI CS 1.6 Server KZ] Checkpointy wylaczone")
       
    return PLUGIN_HANDLED
}

// =================================================================================================

public goto_cp(id,cp) {
    new semiclip = get_pcvar_num(kz_semiclip)
    if(semiclip == -1 || (!noblock[id-1] && semiclip == 0)) {
        new Float:origin[3]
        for(new i=1;i<=get_maxplayers();i++) {
            if(id != i && is_user_connected(i) && is_user_alive(id)) {
                if(semiclip == -1 || (!noblock[i-1] && semiclip == 0)) {
                    entity_get_vector(i,EV_VEC_origin,origin)
                    if(get_distance_f(checkpoints[id-1][cp],origin) <= CP_DISTANCE) {
                        client_print(id,print_chat,"[STI CS 1.6 Server KZ] Ktos stoi na miejscu twojego Checkpointa, prosze poczekaj")
                        return false
                    }
                }
            }
        }
    }
   
    entity_set_origin(id,checkpoints[id-1][cp])
    entity_set_vector(id,EV_VEC_velocity,Float:{0.0,0.0,0.0})
    spawnsprite(checkpoints[id-1][cp])
    set_user_gravity(id) // to fix the low gravity bug on kz_man_redrock (thanks to NoEx)
    noblock_task()
   
    return true
}

// =================================================================================================

public spawnsprite(Float:origin[3]) {
    new iorigin[3]
    iorigin[0] = floatround(origin[0],floatround_ceil)
    iorigin[1] = floatround(origin[1],floatround_ceil)
    iorigin[2] = floatround(origin[2],floatround_ceil)
   
    message_begin(MSG_ALL,SVC_TEMPENTITY)
    write_byte(11)
    write_coord(iorigin[0])
    write_coord(iorigin[1])
    write_coord(iorigin[2])
    message_end()
}

// =================================================================================================

public reset_checkpoints(id) {
    checkpointnum[id-1] = 0
    timer_started[id-1] = false
    client_print(id,print_chat,"[STI CS 1.6 Server KZ] Czas oraz Checkpointy zresetowane")
    return PLUGIN_HANDLED
}

// =================================================================================================

public help(id) {
    if(get_pcvar_num(kz_help) == 1) {
        new name[32]
        get_user_name(id,name,32)
        if(needhelp[id-1]) {
            needhelp[id-1] = false
            client_print(0,print_chat,"[STI CS 1.6 Server KZ] %s nie potrzebuje wiecej pomocy",name)
        }
        else {
            needhelp[id-1] = true
            helpcount[id-1]++
            client_print(0,print_chat,"[STI CS 1.6 Server KZ] %s potrzebuje pomocy",name)
            client_print(id,print_chat,"[STI CS 1.6 Server KZ] Wpisz '.help' ponownie, jezeli juz nie potrzebujesz pomocy",name)
        }
    }
    glow(id)
   
    return PLUGIN_HANDLED
}

// =================================================================================================
// AdminCmds
// =================================================================================================

public admin_unhelp(id,level,cid) {
    new name[32]
    get_user_name(id,name,32)
   
    if(read_argc() == 2) {
        if(!cmd_access(id,level,cid,2))
            return PLUGIN_HANDLED
           
        new sztarget[32]
        read_argv(1,sztarget,32)
        if(equal(sztarget,"@ALL")) {
            for(new i=1;i<=get_maxplayers();i++) {
                if(is_user_connected(i)) {
                    if(needhelp[i-1]) {
                        needhelp[i-1] = false
                        client_print(i,print_chat,"[STI CS 1.6 Server KZ] Admin %s pomogl Ci",name)
                    }
                    glow(i)
                }
            }
        }
        else {
            new target = cmd_target(id,sztarget,2)
            if(target > 0) {   
                if(needhelp[target-1]) {
                    needhelp[target-1] = false
                    client_print(target,print_chat,"[STI CS 1.6 Server KZ] Admin %s pomogl Ci",name)
                }
                glow(target)
               
            }
        }
    }
    else {
        if(!cmd_access(id,level,cid,1))
            return PLUGIN_HANDLED
       
        new aimid, body
        get_user_aiming(id,aimid,body)
        if(aimid > 0 && aimid < 33) {
            needhelp[aimid-1] = false
            glow(aimid)
            client_print(aimid,print_chat,"[STI CS 1.6 Server KZ] Admin %s pomogl Ci",name)
        }
    }
   
    return PLUGIN_HANDLED
}

// =================================================================================================

public admin_showhelp(id,level,cid) {
    if(!cmd_access(id,level,cid,1))
        return PLUGIN_HANDLED
   
    for(new i=1;i<=get_maxplayers();i++) {
        if(is_user_connected(i) && is_user_alive(i) && needhelp[i-1]) {
            message_begin(MSG_ONE,SVC_TEMPENTITY,{0,0,0},id)
            write_byte(8)            // TE_BEAMENTS
            write_short(id)            // start entity
            write_short(i)            // end entity
            write_short(Sbeam)        // sprite to draw (precached below)
            write_byte(0)            // starting frame
            write_byte(0)            // frame rate
            write_byte(100)            // life in 0.1s
            write_byte(3)            // line width in 0.1u
            write_byte(0)            // noise in 0.1u
            write_byte(255)            // R
            write_byte(0)            // G
            write_byte(0)            // B
            write_byte(200)            // brightness
            write_byte(2)            // scroll speed
            message_end()
        }
    }
   
    return PLUGIN_HANDLED
}

// =================================================================================================

public admin_noclip(id,level,cid) {
    if(read_argc() == 1 || read_argc() == 2) {
        if(!cmd_access(id,level,cid,1)) {
            set_user_noclip(id,0)
            return PLUGIN_HANDLED
        }
       
        set_user_noclip(id,get_user_noclip(id) == 1 ? 0 : 1)
        if(get_user_noclip(id) == 1)
            detect_cheat(id,"Noclip")
    }
    else if(read_argc() == 3) {
        if(!cmd_access(id,level,cid,3))
            return PLUGIN_HANDLED
           
        new name[32]
        get_user_name(id,name,32)
       
        new szarg1[32], szarg2[8], bool:mode
        read_argv(1,szarg1,32)
        read_argv(2,szarg2,32)
        if(equal(szarg2,"on"))
            mode = true
       
        if(equal(szarg1,"@ALL")) {
            for(new i=1;i<=get_maxplayers();i++) {
                if(is_user_connected(i) && is_user_alive(i)) {
                    set_user_noclip(i,mode ? 1 : 0)
                    client_print(i,print_chat,"[STI CS 1.6 Server KZ] Admin %s %s noclip",name,mode ? "dal Ci" : "odebral Ci")
                    client_print(i,print_chat,"[STI CS 1.6 Server KZ]  Wpisz '.noclip' by usunac go")
                    if(mode)
                        detect_cheat(i,"Noclip")
                }
            }
        }
        else {
            new pid = cmd_target(id,szarg1,2)
            if(pid > 0 && is_user_alive(pid)) {
                set_user_noclip(pid,mode ? 1 : 0)
                client_print(pid,print_chat,"[STI CS 1.6 Server KZ] Admin %s %s noclip",name,mode ? "dal Ci" : "odebral Ci")
                client_print(pid,print_chat,"[STI CS 1.6 Server KZ]  Wpisz '.noclip' by usunac go")
                if(mode)
                    detect_cheat(pid,"Noclip")
            }
        }
    }
   
    return PLUGIN_HANDLED
}

// =================================================================================================

public admin_teleport(id,level,cid) {
    new name[32]
    get_user_name(id,name,32)
   
    if(read_argc() == 3) {
        if(!cmd_access(id,level,cid,3))
            return PLUGIN_HANDLED
       
        new szarg1[32], szarg2[32]
        read_argv(1,szarg1,32)
        read_argv(2,szarg2,32)
       
        new id1 = cmd_target(0,szarg1,1&4), id2 = cmd_target(0,szarg2,4)
        if(id1 > 0 && id2 > 0) {
            new targetname[32]
            get_user_name(id2,targetname,32)
           
            if(entity_get_int(id2,EV_INT_flags)&FL_DUCKING)
                client_print(id,print_console,"%s is ducking. Can not teleport",targetname)
            else {
                new Float:origin[3]
                entity_get_vector(id2,EV_VEC_origin,origin)
                entity_set_origin(id1,origin)
               
                client_print(id1,print_chat,"[STI CS 1.6 Server KZ] Admin %s teleportowal Cie do %s",name,targetname)
                detect_cheat(id1,"Teleport")
            }
        }
    }
    else {
        if(!cmd_access(id,level,cid,5))
            return PLUGIN_HANDLED
           
        new szarg1[32]
        read_argv(1,szarg1,32)
       
        new target = cmd_target(0,szarg1,1&4)
        if(target > 0) {
            new szargx[8], szargy[8], szargz[8]
            read_argv(2,szargx,8)
            read_argv(3,szargy,8)
            read_argv(4,szargz,8)
           
            new Float:origin[3]
            origin[0] = str_to_float(szargx)
            origin[1] = str_to_float(szargy)
            origin[2] = str_to_float(szargz)
           
            entity_set_origin(target,origin)
            client_print(target,print_chat,"[STI CS 1.6 Server KZ] Admin %s teleportowal Cie",name)
            detect_cheat(target,"Teleport")
        }
    }
       
    return PLUGIN_HANDLED
}

// =================================================================================================

public admin_gravity(id,level,cid) {
    if(!cmd_access(id,level,cid,3))
        return PLUGIN_HANDLED
       
    new name[32]
    get_user_name(id,name,32)
   
    new szarg1[32], szarg2[8], gravity, Float:fgravity
    read_argv(1,szarg1,32)
    read_argv(2,szarg2,8)
    gravity = str_to_num(szarg2)
    fgravity = gravity / float(get_cvar_num("sv_gravity"))
   
    if(equal(szarg1,"@ALL")) {
        for(new i=1;i<=get_maxplayers();i++) {
            if(is_user_connected(i)) {
                set_user_gravity(i,fgravity)
                client_print(i,print_chat,"[STI CS 1.6 Server KZ] Admin %s ustawil ci grawitacje na %d",name,gravity)
                if(fgravity != 1.0)
                    detect_cheat(i,"Gravity")
            }
        }
    }
    else {
        new target = cmd_target(0,szarg1,2)
        if(target > 0) {
            set_user_gravity(target,fgravity)
            client_print(target,print_chat,"[STI CS 1.6 Server KZ] Admin %s ustawil ci grawitacje na %d",name,gravity)
            if(fgravity != 1.0)
                detect_cheat(target,"Gravity")
        }
    }
       
    return PLUGIN_HANDLED
}

// =================================================================================================

public admin_laser(id,level,cid) {
    if(!cmd_access(id,level,cid,1))
        return PLUGIN_HANDLED
       
    new colors[3]
    if(read_argc() > 1) {
        new szcolor[8]
        read_argv(1,szcolor,8)
        if(equal(szcolor,"red"))
            colors = {255,0,0}
        else if(equal(szcolor,"blue"))
            colors = {0,0,255}
        else if(equal(szcolor,"yellow"))
            colors = {255,255,0}
        else if(equal(szcolor,"orange"))
            colors = {255,150,0}
        else if(equal(szcolor,"green"))
            colors = {0,255,0}
        else
            colors = {255,255,255}
    }
    else
        colors = {255,255,255}
       
    new origin[3], aimorigin[3]
    get_user_origin(id,origin)
    get_user_origin(id,aimorigin,3)

    message_begin(MSG_ALL,SVC_TEMPENTITY)
    write_byte(0)            // TE_BEAMPOINTS
    write_coord(origin[0])        // start point
    write_coord(origin[1])
    write_coord(origin[2])
    write_coord(aimorigin[0])    // end point
    write_coord(aimorigin[1])
    write_coord(aimorigin[2])
    write_short(Sbeam)        // sprite to draw (precached below)
    write_byte(0)            // starting frame
    write_byte(0)            // frame rate
    write_byte(100)            // life in 0.1s
    write_byte(3)            // line width in 0.1u
    write_byte(0)            // noise in 0.1u
    write_byte(colors[0])        // R
    write_byte(colors[1])        // G
    write_byte(colors[2])        // B
    write_byte(200)            // brightness
    write_byte(2)            // scroll speed
    message_end()
   
    return PLUGIN_HANDLED
}

// =================================================================================================
// Events / Forwards
// =================================================================================================

public resethud(id) {
    if(get_pcvar_num(kz_godmode) == 1)
        set_user_godmode(id,1)
    else
        set_user_godmode(id)
   
    if(get_pcvar_num(kz_scout) == 1 && !user_has_weapon(id,CSW_SCOUT))
        give_item(id,"weapon_scout")
    if(!user_has_weapon(id,CSW_KNIFE))
        give_item(id,"weapon_knife")
       
    glow(id)
   
    cs_set_user_nvg(id)
   
    if(firstspawn[id-1]) {
        client_print(id,print_chat,"[STI CS 1.6 Server KZ] Wpisz '.menu' by otworzyc KZ_Menu")
        if(get_pcvar_num(kz_checkpoints) == 1)
            client_print(id,print_chat,"[STI CS 1.6 Server KZ] Wpisz '.cp' by zapisac pozycje nastepnie '.tp' by sie do niej teleportowac")
        else
            client_print(id,print_chat,"[STI CS 1.6 Server KZ] Checkpointy wylaczone")
    }
    firstspawn[id-1] = false
}

// =================================================================================================

public client_disconnect(id) {
    checkpointnum[id-1] = 0
    needhelp[id-1] = false
    helpcount[id-1] = 0
   
    timer_started[id-1] = false
    showtimer[id-1] = false
   
    usedbutton[id-1] = false
    firstspawn[id-1] = true
   
    bhop[id-1] = 0
   
    noblock[id-1] = true
}

public client_putinserver(id) {
    checkpointnum[id-1] = 0
    needhelp[id-1] = false
    helpcount[id-1] = 0
   
    timer_started[id-1] = false
    showtimer[id-1] = false
   
    usedbutton[id-1] = false
    firstspawn[id-1] = true
   
    bhop[id-1] = 0
   
    noblock[id-1] = true
}

// =================================================================================================

public deathmsg() {
    new victim = read_data(2)
    set_task(0.5,"respawn",100+victim)
}

// =================================================================================================
// Menu
// =================================================================================================

public kz_menu(id) {
    new menu[512], szbhop[64], sznoblock[64]
   
    if(get_pcvar_num(kz_semiclip) == -1)
        format(sznoblock,64,"\r01. Semiclip disabled by server\w")
    else if(get_pcvar_num(kz_semiclip) == 1)
        format(sznoblock,64,"\r01. Semiclip enabled by server\w")
    else {
        if(noblock[id-1])
            format(sznoblock,64,"\w01. Semiclip\w")
        else
            format(sznoblock,64,"\d01. Semiclip\w")
    }
    // muh
    if(get_pcvar_num(kz_bhop) == 0)
        format(szbhop,64,"\r03. Bhop disabled by server\w")
    else if(get_pcvar_num(kz_bhop) == 1) {
        if(bhop[id-1] == 0)
            format(szbhop,64,"\d03. Bhop\w")
        else
            format(szbhop,64,"\w03. Bhop - No Slowdown\w")
    }
    else if(get_pcvar_num(kz_bhop) == 2) {
        if(bhop[id-1] == 2)
            format(szbhop,64,"\w03. Bhop - Autojump\w")
        else if(bhop[id-1] == 1)
            format(szbhop,64,"\w03. Bhop - No Slowdown\w")
        else
            format(szbhop,64,"\d03. Bhop\w")
    }
   
    format(menu,512,"^n^n^n\yProKreedz by p4ddY^n^n%s^n%s^n%s^n^n04. Respawn^n05. Reset^n^n00. Close",sznoblock,showtimer[id-1] ? "\w02. Show Timer" : "\d02. Show Timer\w",szbhop)
    show_menu(id,MENU_KEYS,menu)
}

public menu_handler(id,key) {
    switch(key) {
        case 0:{
            if(get_pcvar_num(kz_semiclip) != -1 && get_pcvar_num(kz_semiclip) != 1)
                noblock[id-1] = (noblock[id-1] == false)
           
            kz_menu(id)
        }
        case 1:{
            showtimer[id-1] = (showtimer[id-1] == false)
            kz_menu(id)
        }
        case 2:{
            if(get_pcvar_num(kz_bhop) == 1) {
                if(bhop[id-1] == 0)
                    bhop[id-1] = 1
                else
                    bhop[id-1] = 0
            }
            else if(get_pcvar_num(kz_bhop) == 2) {
                if(bhop[id-1] == 0)
                    bhop[id-1] = 1
                else if(bhop[id-1] == 1)
                    bhop[id-1] = 2
                else
                    bhop[id-1] = 0
            }
            kz_menu(id)
        }
        case 3:{
            respawn(id)
        }
        case 4:{
            reset_checkpoints(id)
        }
        case 9:{
            show_menu(id,0,"")
        }
    }
}

// =================================================================================================

public kz_menu_admin_show(id,level,cid) {
    if(!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
       
    kz_menu_admin(id)
   
    return PLUGIN_HANDLED
}

public kz_menu_admin(id) {
    new menu[512], szcheckpoints[32], szgodmode[32], szhelp[32], szscout[32], szadminglow[32], sznoblock[32], sztransparency[32], szcheatdetect[32], szbhop[32]
    // this is the onliest fucking way.. else pawn tells me that the line is too long :o
   
    if(get_pcvar_num(kz_checkpoints) == 1)
        format(szcheckpoints,32,"\w01. Checkpoints\w")
    else
        format(szcheckpoints,32,"\r01. Checkpoints\w")
       
    if(get_pcvar_num(kz_godmode) == 1)
        format(szgodmode,32,"\w02. Godmode\w")
    else
        format(szgodmode,32,"\r02. Godmode\w")
       
    if(get_pcvar_num(kz_help) == 1)
        format(szhelp,32,"\w03. Help\w")
    else
        format(szhelp,32,"\r03. Help\w")
       
    if(get_pcvar_num(kz_scout) == 1)
        format(szscout,32,"\w04. Scout\w")
    else
        format(szscout,32,"\r04. Scout\w")
       
    if(get_pcvar_num(kz_adminglow) == 1)
        format(szadminglow,32,"\w05. Adminglow\w")
    else
        format(szadminglow,32,"\r05. Adminglow\w")
   
    if(get_pcvar_num(kz_semiclip) == -1)
        format(sznoblock,32,"\r06. Semiclip\w")
    else if(get_pcvar_num(kz_semiclip) == 1)
        format(sznoblock,32,"\w06. Semiclip\w")
    else
        format(sznoblock,32,"\w06. Semiclip - Client\w")
       
    if(get_pcvar_num(kz_bhop) == 0)
        format(szbhop,32,"\r07. Bhop\w")
    else if(get_pcvar_num(kz_bhop) == 1)
        format(szbhop,32,"\w07. Bhop - No Slowdown\w")
    else if(get_pcvar_num(kz_bhop) == 2)
        format(szbhop,32,"\w07. Bhop - Autojump\w")
       
    if(get_pcvar_num(kz_transparency) == 1)
        format(sztransparency,32,"\w08. Transparency\w")
    else
        format(sztransparency,32,"\r08. Transparency\w")
   
    format(menu,512,"^n^n^n\yProKreedz by p4ddY - Adminmenu^n^n%s^n%s^n%s^n%s^n%s^n%s^n%s^n%s^n%s^n^n00. Close",szcheckpoints,szgodmode,szhelp,szscout,szadminglow,sznoblock,szbhop,sztransparency,szcheatdetect)
    show_menu(id,MENU_KEYS_ADMIN,menu)
}

public menu_handler_admin(id,key) {
    switch(key) {
        case 0:{
            if(get_cvar_num("kz_checkpoints") == 0) {
                set_cvar_num("kz_checkpoints",1)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Checkpointy zostaly aktywowane")
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Wpisz '.cp' by zapisac pozycje nastepnie '.tp' by sie do niej teleportowac")
            }
            else {
                set_cvar_num("kz_checkpoints",0)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Checkpointy zostaly wylaczone ")
            }
            kz_menu_admin(id)
        }
        case 1:{
            if(get_cvar_num("kz_godmode") == 0) {
                set_cvar_num("kz_godmode",1)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Godmode wlaczony")
               
                for(new i=1;i<=get_maxplayers();i++) {
                    if(is_user_connected(i))
                        set_user_godmode(id,1)
                }
            }
            else {
                set_cvar_num("kz_godmode",0)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Godmode wylaczony")
               
                for(new i=1;i<=get_maxplayers();i++) {
                    if(is_user_connected(i))
                        set_user_godmode(id,0)
                }
            }
            kz_menu_admin(id)
        }
        case 2:{
            if(get_cvar_num("kz_help") == 0) {
                set_cvar_num("kz_help",1)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Backup zostal aktywowany")
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Wpisz '.help' jezeli potrzebujesz pomocy")
                for(new i=1;i<=get_maxplayers();i++) {
                    if(is_user_connected(i))
                        glow(i)
                }
            }
            else {
                set_cvar_num("kz_help",0)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Backup zostal wylaczony")
                for(new i=1;i<=get_maxplayers();i++) {
                    if(is_user_connected(i))
                        glow(i)
                }
            }
            kz_menu_admin(id)
        }
        case 3:{
            if(get_cvar_num("kz_scout") == 0) {
                set_cvar_num("kz_scout",1)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Otrzymasz Scouta na starcie")
            }
            else {
                set_cvar_num("kz_scout",0)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Nie otrzymasz wiecej Scouta")
            }
            kz_menu_admin(id)
        }
        case 4:{
            if(get_cvar_num("kz_adminglow") == 0) {
                set_cvar_num("kz_adminglow",1)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Admin od teraz swieca na Zielono")
               
                for(new i=1;i<=get_maxplayers();i++) {
                    if(is_user_connected(i))
                        glow(i)
                }
            }
            else {
                set_cvar_num("kz_adminglow",0)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Admini juz nie swieca")
               
                for(new i=1;i<=get_maxplayers();i++) {
                    if(is_user_connected(i))
                        glow(i)
                }
            }
            kz_menu_admin(id)
        }
        case 5:{
            if(get_cvar_num("kz_semiclip") == -1) {
                set_cvar_num("kz_semiclip",0)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Semiclip zostal aktywowany. Wpisz '.menu' by wlaczyc/wylaczyc to")
            }
            else if(get_cvar_num("kz_semiclip") == 0) {
                set_cvar_num("kz_semiclip",1)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Semiclip zostal aktywowany")
            }
            else {
                set_cvar_num("kz_semiclip",-1)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Semiclip zostal wylaczony")
            }
            kz_menu_admin(id)
        }
        case 6:{
            if(get_cvar_num("kz_bhop") == 0) {
                set_cvar_num("kz_bhop",1)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Bhop (Bez Zwolnienia) zostal aktywowany")
            }
            else if(get_cvar_num("kz_bhop") == 1) {
                set_cvar_num("kz_bhop",2)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Bhop (Auto Skok) zostal aktywowany")
            }
            else {
                set_cvar_num("kz_bhop",0)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Bhop zostal wylaczony")
            }
            kz_menu_admin(id)
        }
        case 7:{
            if(get_cvar_num("kz_transparency") == 0) {
                set_cvar_num("kz_transparency",1)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Jezeli ktos wlaczy semiclip stanie sie przezroczysty")
            }
            else {
                set_cvar_num("kz_transparency",0)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Jezeli ktos ponownie wlaczy semiclip nie bedzie wiecej przezroczysty")
            }
            kz_menu_admin(id)
        }
        case 8:{
            if(get_cvar_num("kz_cheatdetect") == 0) {
                set_cvar_num("kz_cheatdetect",1)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Anti-Cheat zostal aktywowany")
            }
            else {
                set_cvar_num("kz_cheatdetect",0)
                client_print(0,print_chat,"[STI CS 1.6 Server KZ] Anti-Cheat zostal wylaczony - zglos ten fakt na WebSite podajac jacy admini byli aktualnie na Serverze")
            }
            kz_menu_admin(id)
        }
        case 9:{
            show_menu(id,0,"")
        }
    }
}

// =================================================================================================
// Timersystem
// =================================================================================================

public client_PreThink(id) {
    if(get_pcvar_num(kz_bhop) > 0 && bhop[id-1] > 0)
        entity_set_float(id,EV_FL_fuser2,0.0)
       
    new buttons = get_user_button(id)
       
    if(get_pcvar_num(kz_bhop) == 2 && bhop[id-1] == 2) {
        if(buttons&IN_JUMP) { // Credits to ts2do (cs13 plugin)
            new flags = entity_get_int(id,EV_INT_flags)
            if(flags&FL_ONGROUND && flags|FL_WATERJUMP && entity_get_int(id,EV_INT_waterlevel)<2) {
                new Float:velocity[3]
                entity_get_vector(id,EV_VEC_velocity,velocity)
                velocity[2] += 260.0
                entity_set_vector(id,EV_VEC_velocity,velocity)
                entity_set_int(id,EV_INT_gaitsequence,6) // Play the Jump Animation
            }
        }
    }
   
    if(buttons&IN_USE) {
        if(!usedbutton[id-1]) {
            new aimid, body
            if(get_user_aiming(id,aimid,body) != 0.0) {
                new Float:origin[3]
                entity_get_vector(id,EV_VEC_origin,origin)
                if(find_ent_in_sphere(aimid-1,origin,BUTTON_DISTANCE) == aimid) { // This sucks, but i was not able, to get EV_VEC_origin of the button
                    new entname[32]
                    entity_get_string(aimid,EV_SZ_target,entname,32)
                    //client_print(id,print_chat,"[Debug] Entityname: %s",entname)
                    if((equal(entname,"counter_start") || equal(entname,"clockstartbutton") || equal(entname,"firsttimerelay")) && !timer_started[id-1]) { // Man hat den Startbutton gedrueckt
                        if(checkpointnum[id-1] < 1) {
                            new bool:clean = true
                            if(get_pcvar_num(kz_cheatdetect) == 1) {
                                if(get_user_noclip(id) == 1) {
                                    client_print(id,print_chat,"[STI CS 1.6 Server KZ] Nie mozesz uruchomic zegara, wylacz opcje noclip")
                                    clean = false
                                }
                                else if(get_user_gravity(id) != 1.0) {
                                    client_print(id,print_chat,"[STI CS 1.6 Server KZ] Nie mozesz uruchomic zegara z powodu grawitacji")
                                    clean = false
                                }
                                else { // Now we check, whether the client uses hook or is grabbed :o
                                    if(callfunc_begin("is_hooked","prokreedz_hook.amxx") == 1) {
                                        callfunc_push_int(id)
                                        if(callfunc_end()) {
                                            clean = false
                                            client_print(id,print_chat,"[STI CS 1.6 Server KZ] Nie mozesz uruchomic zegara z powodu Hooka")
                                        }
                                    }
                                    else if(callfunc_begin("is_user_grabbed","prokreedz_grab.amxx") == 1) { // maybe it doesn't work Oo
                                        callfunc_push_int(id)
                                        if(callfunc_end() != -1) {
                                            clean = false
                                            client_print(id,print_chat,"[STI CS 1.6 Server KZ] Nie mozesz uruchomic zegara z powodu Graba")
                                        }
                                    }
                                }
                            }
                            if(clean) {
                                client_print(id,print_chat,"[STI CS 1.6 Server KZ] Czas Start, powodzenia :)")
                                timer_started[id-1] = true
                                timer_time[id-1] = get_systime()
                            }
                        }
                        else {
                            client_print(id,print_chat,"[STI CS 1.6 Server KZ] Jestes gotowy na zapisywanie pozycji - Checkpointy. Wpisz '.reset'  by je zresetowac")
                        }
                    }
                    if((equal(entname,"counter_off") || equal(entname,"clockstopbutton") || equal(entname,"clockstop")) && timer_started[id-1]) { // Man hat den Stopbutton gedrueckt
                        new name[32], imin
                        get_user_name(id,name,32)
                        //format_time(sztime,16,"%M:%S",get_systime() - timer_time[id-1]) this sucks!
                        new kreedztime = get_systime() - timer_time[id-1]
                        if((kreedztime / 60.0) >= 1) {
                            imin = floatround(kreedztime / 60.0,floatround_floor)
                            kreedztime -= (floatround(kreedztime / 60.0,floatround_floor) * 60)
                        }
                       
                        new random_R = random_num(50,255), random_G = random_num(50,255), random_B = random_num(50,255)
                        set_hudmessage(random_R,random_G,random_B,-1.0,-2.0,1,8.0,8.0,0.5,0.5,4)
                        show_hudmessage(0,"^n^n^n%s ukonczyl mape w czasie: %d:%d ^nUzywajac: %d checkpoint%ow.",name,imin,kreedztime,checkpointnum[id-1],checkpointnum[id-1] == 1 ? "" : "s")
                        timer_started[id-1] = false
                        topten_update(id)
                    }
                }
            }
            usedbutton[id-1] = true
        }
    }
    else
        usedbutton[id-1] = false
}

// =================================================================================================
// Top10
// =================================================================================================

public topten_update(id) {
    new name[32], imin
    get_user_name(id,name,32)
    new szvault[64], szmap[32], kreedztime
    get_mapname(szmap,32)
    format(szvault,64,"pk_%s",szmap)
    kreedztime = get_systime() - timer_time[id-1]
    new random_S = random_num(50,255), random_D = random_num(50,255), random_F = random_num(50,255)
   
    new vault = nvault_open(szvault) // Now we have to sort the new list :o
    if(vault != -1) {
        new szkey[8]
        for(new i=1;i<=10;i++) {
            new szreturn[128]
            new arg1[32], arg2[8]
            format(szkey,8,"%d",i)
            nvault_get(vault,szkey,szreturn,128)
           
            if(parse(szreturn,arg1,32,arg2,8) == 0 || kreedztime < str_to_num(arg2)) {
                new sznew[128], szname[32]
                get_user_name(id,szname,32)
                format(sznew,128,"^"%s^" ^"%d^" ^"%d^"",szname,kreedztime,checkpointnum[id-1])
                if(i < 10) {
                    for(new x=10;x>i;x--) {
                        new sztemp[128], sztempkey[8]
                        format(sztempkey,8,"%d",x-1)
                        nvault_get(vault,sztempkey,sztemp,128)
                       
                        if(!equal(sztemp,"")) {
                            format(sztempkey,8,"%d",x)
                            nvault_pset(vault,sztempkey,sztemp)
                        }
                    }
                }
                nvault_pset(vault,szkey,sznew)
               
                if(i == 1){
                        set_hudmessage(random_S,random_D,random_F,-1.0,-2.0,1,8.0,8.0,0.5,0.5,4)
                        show_hudmessage(0,"^n^n^nGratulacje: %s ^n Ukonczyl mape w czasie: %d:%d ^nUzywajac: %d checkpoint%ow.^nCzas ten ustanowil nowy rekord Mapy.",name,imin,kreedztime,checkpointnum[id-1],checkpointnum[id-1] == 1 ? "" : "s")
                }
                break
            }
        }
        nvault_close(vault)
    }
}

public topten_show(id) {
    new motd[2048]
    new szvault[64], szmap[32]
    get_mapname(szmap,32)
    format(szvault,64,"pk_%s",szmap)
   
    new vault = nvault_open(szvault)
    if(vault != -1) {
        add(motd,2048,"<html><head><style>")
        add(motd,2048,"body { background-color:#000000; font-family:Tahoma; font-size:10px; color:#FFFFFF; }")
        add(motd,2048,".tabel { border-style:solid; border-width:1px; border-color:#FFFFFF; font-family:Tahoma; font-size:10px; color:#FFFFFF; }")
        add(motd,2048,".header { background-color:#292929; font-family:Tahoma; font-size:10px; color:#FFFFFF; font-weight:800; }")
        add(motd,2048,"</style></head><body>")
        add(motd,2048,"<br><br><table border=0 cellspacing=0 cellpadding=1 width=90% align=center class=tabel>")
       
        add(motd,2048,"<tr><td class=header>#</td><td class=header>Nick</td><td class=header>Czas</td><td class=header>Checkpointy</td></tr>")
        new szkey[8]
        for(new i=1;i<=10;i++) {
            new szreturn[128]
            format(szkey,8,"%d",i)
            nvault_get(vault,szkey,szreturn,128)
           
            new arg1[32], arg2[8], arg3[8]
            if(parse(szreturn,arg1,32,arg2,8,arg3,8) != 0) {
                new sztime[32]
                new imin, kreedztime = str_to_num(arg2)
                if((kreedztime / 60.0) >= 1) {
                    imin = floatround(kreedztime / 60.0,floatround_floor)
                    kreedztime -= (floatround(kreedztime / 60.0,floatround_floor) * 60)
                }
                format(sztime,32,"%d minutes and %d seconds",imin,kreedztime)
                add(motd,2048,"<tr><td>")
                add(motd,2048,szkey)
                add(motd,2048,"</td><td>")
                add(motd,2048,arg1)
                add(motd,2048,"</td><td>")
                add(motd,2048,sztime)
                add(motd,2048,"</td><td>")
                add(motd,2048,arg3)
                add(motd,2048,"</td></tr>")
            }
        }
       
        nvault_close(vault)
       
        add(motd,2048,"</table></body></html>")
        show_motd(id,motd,"ProKreedz Top10")
    }
}

// You reached the end of file
// This plugin was made by p4ddY :)


The Specialist 11-04-2006 17:20

Re: help with editing sma plugin file (prokreedz)
 
im not completley sure , but if you use the old style hud messages , theres only 4 channels that a player can diplay them on with out over lapping (running out of free channels) the new style of hud messages wont. as for this plugin , i have no idea what it is . what does it do?:|

berix 11-09-2006 15:31

Re: help with editing sma plugin file (prokreedz)
 
So cheers mate you for your suggestion whitch I used i changed that line, now it looks:

set_hudmessage(255, 255, 225,-1.0,-2.0,1,8.0,8.0,0.5,0.5,1)

and indeed message doesn't disappear after one second, but you told something about 4 channels, could you tell me something more about it ? maybe you have a link to webpage that contains some good informations about it ?


All times are GMT -4. The time now is 04:51.

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