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

My plugin failed to compile!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
X3N0M
New Member
Join Date: Apr 2019
Old 04-14-2019 , 20:16   My plugin failed to compile!
Reply With Quote #1

Hi friends!
If I try to compile this plugin an error appears, can you help me?
Or does someone have a plugin that at the beginning of the round shows the teammates money in the chat?

Plugin:

Code:
#include <amxmodx>
#include <cstrike>

#define MAX_ROWS 5

public plugin_init()
{
    register_plugin("Show Team Money", "1.0", "OciXCrom")
    register_logevent("OnRoundStart", 2, "1=Round_Start")
}

public OnRoundStart()
{
    new szMoneyT[MAX_ROWS][128], szMoneyCT[MAX_ROWS][128], iPlayers[32], iPnum
    get_players(iPlayers, iPnum)

    for(new i, c, t, iPlayer, szName[32]; i < iPnum; i++)
    {
        iPlayer = iPlayers[i]
        
        switch(cs_get_user_team(iPlayer))
        {
            case CS_TEAM_T:
            {
                if(t >= MAX_ROWS - 1)
                    continue

                get_user_name(iPlayer, szName, charsmax(szName))
                formatex(szMoneyT[t], charsmax(szMoneyT[]), "* Your teammate %s has got %i$", szName, cs_get_user_money(iPlayer))
                t++
            }
            case CS_TEAM_CT:
            {
                if(c >= MAX_ROWS - 1)
                    continue

                get_user_name(iPlayer, szName, charsmax(szName))
                formatex(szMoneyCT[c], charsmax(szMoneyCT[]), "* Your teammate %s has got %i$", szName, cs_get_user_money(iPlayer))
                c++
            }
        }
    }

    for(new i; i < iPnum; i++)
    {
        switch(cs_get_user_team(iPlayers[i])
        {
            case CS_TEAM_T:
            {
                for(new t; t < MAX_ROWS - 1; t++)
                    client_print(iPlayers[i], print_chat, szMoneyT[t])
            }
            case CS_TEAM_CT:
            {
                for(new c; c < MAX_ROWS - 1; c++)
                    client_print(iPlayers[i], print_chat, szMoneyCT[c])
            }
        }
    }
}

Error:

Your plugin failed to compile! Read the errors below:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/tmp/textr13btR.sma(47) : error 001: expected token: ")", but found "{"

1 Error.
Could not locate output file /home/groups/amxmodx/public_html/websc3/textr13btR.amx (compile failed).
Attached Thumbnails
Click image for larger version

Name:	Capturar.PNG
Views:	79
Size:	16.8 KB
ID:	174998  

Last edited by X3N0M; 04-15-2019 at 12:58.
X3N0M is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 04-14-2019 , 22:06   Re: My plugin failed to compile!
Reply With Quote #2

Line 46, add one more )

switch(cs_get_user_team(iPlayers[i]))
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-15-2019 , 07:16   Re: My plugin failed to compile!
Reply With Quote #3

Please put your code in [php] or [code] tags in order to make it readable.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
husam124
Member
Join Date: Jul 2017
Location: Palestine
Old 04-17-2019 , 09:43   Re: My plugin failed to compile!
Reply With Quote #4

Code:
public plugin_init()
{
    register_plugin("Show Team Money", "1.0", "OciXCrom")
New OciXCrom founded

Last edited by husam124; 04-17-2019 at 09:45.
husam124 is offline
Dragos
Senior Member
Join Date: Oct 2018
Location: Romania
Old 04-17-2019 , 14:20   Re: My plugin failed to compile!
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <cstrike>

#define MAX_ROWS 5

public plugin_init()
{
    
register_plugin("Show Team Money""1.0""OciXCrom")
    
register_logevent("OnRoundStart"2"1=Round_Start")
}

public 
OnRoundStart()
{
    new 
szMoneyT[MAX_ROWS][128], szMoneyCT[MAX_ROWS][128], iPlayers[32], iPnum
    get_players
(iPlayersiPnum)

    for(new 
ictiPlayerszName[32]; iPnumi++)
    {
        
iPlayer iPlayers[i]
        
        switch(
cs_get_user_team(iPlayer))
        {
            case 
CS_TEAM_T:
            {
                if(
>= MAX_ROWS 1)
                    continue

                
get_user_name(iPlayerszNamecharsmax(szName))
                
formatex(szMoneyT[t], charsmax(szMoneyT[]), "* Your teammate %s has got %i$"szNamecs_get_user_money(iPlayer))
                
t++
            }
            case 
CS_TEAM_CT:
            {
                if(
>= MAX_ROWS 1)
                    continue

                
get_user_name(iPlayerszNamecharsmax(szName))
                
formatex(szMoneyCT[c], charsmax(szMoneyCT[]), "* Your teammate %s has got %i$"szNamecs_get_user_money(iPlayer))
                
c++
            }
        }
    }

    for(new 
iiPnumi++)
    {
        switch(
cs_get_user_team(iPlayers[i]))
        {
            case 
CS_TEAM_T:
            {
                for(new 
tMAX_ROWS 1t++)
                    
client_print(iPlayers[i], print_chatszMoneyT[t])
            }
            case 
CS_TEAM_CT:
            {
                for(new 
cMAX_ROWS 1c++)
                    
client_print(iPlayers[i], print_chatszMoneyCT[c])
            }
        }
    }

__________________
sup
Dragos is offline
Reply


Thread Tools
Display Modes

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:34.


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