AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help]Some Errors (https://forums.alliedmods.net/showthread.php?t=62567)

emoD 10-30-2007 09:13

[Help]Some Errors
 
Hello, I'm Creating Match Plugin And I Wrote Some Code

HTML Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "Tourney"
#define VERSION "1.0"
#define AUTHOR "emoD"

new team_name[2][32]
new Game_Status = 0
new Half = 0
new team_wins[2]

public plugin_init() {
        register_plugin(PLUGIN, VERSION, AUTHOR)
       
        register_clcmd("em_start", "Game_Begin")
        register_event("TeamScore", "team_score", "a")
        register_event("HLTV", "new_round", "a", "1=0", "2=0")
}


public Game_Begin(id, level, cid)
{
        Game_Status = 1
        Half = 1
       
        read_argv(1, team_name[0], 31)
        read_argv(1, team_name[1], 32)
       
        set_task(2.0, "Msg_TeamName")
        set_task(4.0, "Msg_Live")
        set_task(6.0, "Msg_Live1")
        set_task(8.0, "restart_round", 0, "1", 1)
        set_task(10.0, "restart_round", 0, "1", 1)
        set_task(12.0, "restart_round", 0, "3", 1)
        set_task(17.0, "Msg_Live2")
        set_task(18.0, "Msg_Live3")
       
        return PLUGIN_HANDLED
}
       
public restart_round(time[])
{
        server_cmd("sv_restart %s", time)
}

public Msg_Live()
{
        client_print(0, print_chat, "Console: All Players Ready Up, Game Starting!")
}

public Msg_Live1()
{
        client_print(0, print_chat, "Console: Three Restarts Then Game Is Live!")
}

public Msg_Live2()
{
        client_print(0, print_chat, "Console: Game Is ON!")
}

public Msg_Live3()
{
        client_print(0, print_chat, "Console: Good Luck And Have Fun!")
}

public Msg_TeamName()
{
        client_print(0, print_chat, "Console: %s VS %s", team_name[0], team_name[1])
}

public team_score()
{
        new team[2]
        read_data(1, team, 1)
       
        if (team[0] == 'C')
          team_wins[0] = read_data(2)
 
        else if(team[0] == 'T')
          team_wins[1] = read_data(2)
 
        if(team_wins[0]+team_wins[1] == 15) && (Half == 1)
        {
          Half = 2
          client_print(0, print_chat, "Console: First Half Ended, Please Change")
          client_print(0, print_chat, "Console: After 15 Seconds Second Half Begins")
         
          set_task(2.0, "restart_round", 0, "15", 1)
          set_task(20.0, "Msg_Live")
          set_task(21.0, "Msg_Live1")
          set_task(23.0, "restart_round", 0, "1", 1)
          set_task(25.0, "restart_round", 0, "1", 1)
          set_task(27.0, "restart_round", 0, "3", 1)
          set_task(31.0, "Msg_Live2")
          set_task(31.5, "Msg_Live3")
          } else if(Half == 2) { return PLUGIN_HANDLED }
 return PLUGIN_CONTINUE
}

And When I Try To Compile It , It Shows Me Alot Of Errors :(

Code:

/home/groups/amxmodx/tmp3/textgekdyY.sma(20) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textgekdyY.sma(33) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textgekdyY.sma(34) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textgekdyY.sma(85) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textgekdyY.sma(85) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/textgekdyY.sma(85 -- 86) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/textgekdyY.sma(92) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textgekdyY.sma(93) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textgekdyY.sma(99) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textgekdyY.sma(99) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/textgekdyY.sma(99) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/textgekdyY.sma(99) : error 001: expected token: ";", but found "if"
/home/groups/amxmodx/tmp3/textgekdyY.sma(99) : error 001: expected token: ";", but found "}"
/home/groups/amxmodx/tmp3/textgekdyY.sma(99) : fatal error 107: too many error messages on one line

Compilation aborted.
6 Errors.

And I Don't Know How To Fix It , I Tryied To Search Some Doc's But For About 1 Hour I Got Totaly Confused.
Please Help Me :(

ConnorMcLeod 10-30-2007 09:45

Re: [Help]Some Errors
 
The only error is there :
Code:
if(team_wins[0]+team_wins[1] == 15) && (Half == 1)

-->
Code:
if(team_wins[0]+team_wins[1] == 15 && Half == 1)


Loose identation is only warnings
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #define PLUGIN "Tourney" #define VERSION "1.0" #define AUTHOR "emoD" new team_name[2][32] new Game_Status = 0 new Half = 0 new team_wins[2] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_clcmd("em_start", "Game_Begin")     register_event("TeamScore", "team_score", "a")     register_event("HLTV", "new_round", "a", "1=0", "2=0") } public Game_Begin(id, level, cid) {     Game_Status = 1     Half = 1         read_argv(1, team_name[0], 31)     read_argv(1, team_name[1], 32)         set_task(2.0, "Msg_TeamName")     set_task(4.0, "Msg_Live")     set_task(6.0, "Msg_Live1")     set_task(8.0, "restart_round", 0, "1", 1)     set_task(10.0, "restart_round", 0, "1", 1)     set_task(12.0, "restart_round", 0, "3", 1)     set_task(17.0, "Msg_Live2")     set_task(18.0, "Msg_Live3")         return PLUGIN_HANDLED }     public restart_round(time[]) {     server_cmd("sv_restart %s", time) } public Msg_Live() {     client_print(0, print_chat, "Console: All Players Ready Up, Game Starting!") } public Msg_Live1() {     client_print(0, print_chat, "Console: Three Restarts Then Game Is Live!") } public Msg_Live2() {     client_print(0, print_chat, "Console: Game Is ON!") } public Msg_Live3() {     client_print(0, print_chat, "Console: Good Luck And Have Fun!") } public Msg_TeamName() {     client_print(0, print_chat, "Console: %s VS %s", team_name[0], team_name[1]) } public team_score() {     new team[2]     read_data(1, team, 1)         if (team[0] == 'C')            team_wins[0] = read_data(2)       else if(team[0] == 'T')         team_wins[1] = read_data(2)       if( team_wins[0]+team_wins[1] == 15 && Half == 1)     {         Half = 2         client_print(0, print_chat, "Console: First Half Ended, Please Change")         client_print(0, print_chat, "Console: After 15 Seconds Second Half Begins")               set_task(2.0, "restart_round", 0, "15", 1)         set_task(20.0, "Msg_Live")         set_task(21.0, "Msg_Live1")         set_task(23.0, "restart_round", 0, "1", 1)         set_task(25.0, "restart_round", 0, "1", 1)         set_task(27.0, "restart_round", 0, "3", 1)         set_task(31.0, "Msg_Live2")         set_task(31.5, "Msg_Live3")     } else if(Half == 2) {         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }

emoD 10-30-2007 09:52

Re: [Help]Some Errors
 
thanks very much :*


All times are GMT -4. The time now is 01:17.

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