Raised This Month: $ Target: $400
 0% 

Stack Error - What am I doing wrong?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Podunk
Senior Member
Join Date: Nov 2005
Location: Florida
Old 10-07-2007 , 15:48   Re: Stack Error - What am I doing wrong?
Reply With Quote #8

pulling my hair out on this problem

Code:
#include <amxmodx>
#include <amxmisc>
#include <ggl>
 
 
#define PLUGIN "ggl_scoreboard"
#define VERSION "0.0.9"
#define AUTHOR "FoolyCooly"
//#define keysscoremenu (1<<8)
#define keysscoremenu (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9) // Keys: 1234567890
#define instructions "say( aa=all aw=tips ad=time aw=mode )"
#define MAXLINES 8
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_menucmd(register_menuid("scores"), keysscoremenu, "pressedscoremenu");
    register_clcmd("say","cmd_say");
    //register_clcmd("say_team","cmd_say");
    register_cvar("gg_scoreboard_0","");
    for(new i=0;i<32;i++){
        toggle_set(i,TOGGLE_SHOW_SCOREBOARD,1);
        toggle_set(i,TOGGLE_SHOW_TIPS,1);
        toggle_set(i,TOGGLE_SHOW_TIME,1);
    }
    set_task(1.0,"tick");
}
public tick(){
    new humans[32],humanCount;
    get_players(humans, humanCount, "c");
    for (new i=0;i<humanCount;i++){
        new id = humans[i];
        if (toggle_get(id,TOGGLE_DISP) == DISP_SCOREBOARD)
        {
            if (toggle_get(id,TOGGLE_SHOW_SCOREBOARD))
                showscores(id);
        }
    }
    set_task(1.0,"tick");
    return PLUGIN_CONTINUE;
}
public cmd_say(id){
    new arg[192]
    read_args(arg, 191)
    remove_quotes(arg) // Say Message are encase in Quotes
    
    client_print(0, print_chat, "[ZOMG Say] %s", arg)
    
/*
    server_print("42");
    return PLUGIN_CONTINUE;

    static said[256];
    read_argv(1,said,255);
    if(equali(said,"aa")){

        server_print("49");

    
        if (toggle_get(id,TOGGLE_SHOW_SCOREBOARD) == YES){

            server_print("54");

            toggle_set(id,TOGGLE_SHOW_SCOREBOARD,NO);
        }
        else {

            server_print("60");

            toggle_set(id,TOGGLE_SHOW_SCOREBOARD,YES);
        }
    }
    if(equali(said,"as")){
        if (toggle_get(id,TOGGLE_SHOW_TIPS) == YES)
            toggle_set(id,TOGGLE_SHOW_TIPS,NO);
        else
            toggle_set(id,TOGGLE_SHOW_TIPS,YES);
    }
    if(equali(said,"ad")){
        if (toggle_get(id,TOGGLE_SHOW_TIME) == YES)
            toggle_set(id,TOGGLE_SHOW_TIME,NO);
        else
            toggle_set(id,TOGGLE_SHOW_TIME,YES);
    }
    /*
    if(equali(said,"aw")){
        if (toggle_get(id,TOGGLE_AW) == 1)
            toggle_set(id,TOGGLE_AW,0);
        else
            toggle_set(id,TOGGLE_AW,1);
    }
    */

    return PLUGIN_CONTINUE;
}
public showscores(id) {
    new i,linecount = 0; 
    new statustext[1024];
    get_cvar_string("gg_scoreboard_0", statustext,1023);
    new a;
    new ch = 0;
    new dial=0;
    new msg[33][33]; // md5 is 32 bytes; [field][32+1];
    for(i=0;(i<1024 && dial<33);i++){ 
        ch = statustext[i];
        if (ch != 0){
            if(ch == 59){ //59=;
                dial++;
                a=0;
                i=i+1; //skip delimiter
                ch = statustext[i];
            }
            if (a < 33){
                msg[dial][a] = ch;
                a++;
            }
        }
        else
        {
            break;
        }
    }
    new line_level;
    new line_gun[32];
    new line_progress1;
    new line_progress2;
    new line_playerid;
    new line_name[32];
    new line_color[3];
    new name_color[3];
    dial = 0;
    statustext = "";
    new team = false;
    new line_team = 0;
    for(i=0;i<MAXLINES;i++){
        if (!equal(msg[i],Empty_String)){
            new left[32] = "";
            new right[32] = "";
            strtok(msg[i], left, 31, right, 31, '|');
            line_playerid = str_to_num(left);
            strtok(right, left, 31, right, 31, '|');
            line_level = str_to_num(left);
            strtok(right, line_gun, 31, right, 31, '|');
            strtok(right, left, 31, right, 31, '|');
            line_progress1 = str_to_num(left);
            strtok(right, left, 31, right, 31, '|');
            line_progress2 = str_to_num(left);
            line_color = GRAY;
            name_color = GRAY;
            if (line_playerid > 0){
                team = false;
                line_team = get_user_team(line_playerid);
                get_user_name(line_playerid,line_name,31);
            }
            else {
                team = true;
                line_team = abs(line_playerid);
                if(line_team == 1) //axis/terr
                {
                    line_color = RED;
                }
                else //allies/ct
                {
                    line_color = YELLOW;
                }
                line_name = "";
            }
            if (!team){
                if(line_team == 1) //axis/terr
                {
                    line_color = GRAY;
                    name_color = RED;
                }
                else if(line_team == 2) //allies/ct
                {
                    line_color = GRAY;
                    name_color = YELLOW;
                }
                
                else if(line_team == 3) //spec
                {
                    line_color = GRAY;
                    name_color = GRAY;
                }
                if (line_playerid == id)
                {
                    line_color = WHITE;
                    name_color = WHITE;
                }
            }
            format(statustext, 511,"%s%sL %d %d/%d (%s) %s%s^n",statustext,line_color,line_level,line_progress1,line_progress2,line_gun,name_color,line_name);
            linecount++;
        }
    }
    /*
    if (toggle_get(i,TOGGLE_AW)){
        new mode = toggle_get(40,TOGGLE_MODE);
        new mode_name[32] = "?????????";
        switch(mode){
            case MODE_PUB_TEAM:{
                mode_name = "PUB TEAMPLAY";
            }
            case MODE_PUB_FFA:{
                mode_name = "PUB FFA";
            }
            case MODE_GGL_TEAM:{
                mode_name = "TOURNAMENT TEAMPLAY";
            }
            case MODE_GGL_FFA:{
                mode_name = "TOURNAMENT FFA";
            }
        }
        format(statustext, 511,"%s%s%s^n",statustext,GRAY,mode_name);//mode
    }
    */
    if (toggle_get(i,TOGGLE_SHOW_TIPS)){
        format(statustext, 511,"%s%s%s^n",statustext,GRAY,instructions);    //tips
    }
    if (toggle_get(i,TOGGLE_SHOW_TIME)){
        new th,tm,ts;
        time ( th, tm, ts );
        format(statustext, 511,"%s%s%s:%s:%s EST^n",statustext,WHITE,th,tm,ts);//time
    }
    show_menu(id, keysscoremenu,statustext , 2, "scores");
    return PLUGIN_CONTINUE;
}
public pressedscoremenu(id, key) {
    switch (key) {
        case 0: { // 1
            client_cmd(id, "slot1");
        }
        case 1: { // 2
            client_cmd(id, "slot2");
        }
        case 2: { // 3
            client_cmd(id, "slot3");
        }
        case 3: { // 4
            client_cmd(id, "slot4");
        }
        case 4: { // 5
            client_cmd(id, "slot5");
        }
        case 5: { // 6
            client_cmd(id, "slot6");
        }
        case 6: { // 7
            client_cmd(id, "slot7");
        }
        case 7: { // 8
            client_cmd(id, "slot8");
        }
        case 8: { // 9
            client_cmd(id, "slot9");
        }
        case 9: { // 0
            client_cmd(id, "slot0");
        }
    }
    //change_menu(id,0);
}
__________________
Check out my website at http://matthewmiller.info
Podunk is offline
Send a message via MSN to Podunk
 



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 16:08.


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