AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Error in compling (https://forums.alliedmods.net/showthread.php?t=109959)

Cola717 11-23-2009 07:38

Error in compling
 
Where is error??? :
Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
static const COLOR[] = "^x03"
static const CONTACT[] = "Your skype!!
new maxplayers
new gmsgSayText

public plugin_init()
{
        register_plugin("HNS Vipas", "1.0", "by Armasi , Edited by Cola")

        register_logevent("Round_Start", 2, "1=Round_Start")
        register_menucmd(register_menuid("menu_rod"), 1023, "Pressedrod")
        register_clcmd("say /noriuvip","ShowMotd")
        maxplayers = get_maxplayers()
        gmsgSayText = get_user_msgid("SayText")
        register_clcmd("say", "handle_say")
        register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)

}

public Round_Start()
        set_task(11.0, "Uzdelstas_meniu")
       
public Uzdelstas_meniu()
{
        new players[32], pnum
        get_players(players, pnum, "a")

        for (new i = 0; i < pnum; i++)
        {
                new player = players[i]

                if (get_user_flags(player) & ADMIN_LEVEL_H)
                {
                        ShowmenuID(player)
                }
        }

        return PLUGIN_HANDLED
}

public ShowmenuID(id)
{
        new Body[512]
        new CsTeams:iTeam = cs_get_user_team(id)

        if (iTeam == CS_TEAM_T)
        {
                add(Body, 511, "\rVIP menu: \R\dB e g l i a m s^n^n")
                add(Body, 511, "\r1. \w+20HP^n")
                add(Body, 511, "\r2. \w+10HP/10sec^n")
                add(Body, 511, "\r3. \w250AP^n")
                add(Body, 511, "\r0. \wIseiti^n")
        }

        else if (iTeam == CS_TEAM_CT)
        {
                add(Body, 511, "\rVIP menu: \R\dS e k l i a m s^n^n")
                add(Body, 511, "\r1. \w+20HP^n")
                add(Body, 511, "\r2. \wHE granata^n")
                add(Body, 511, "\r3. \w250AP^n")
                add(Body, 511, "\r4. \w+10HP/10sec^n")
                add(Body, 511, "\r0. \wIseiti^n")
        }

        new g_Keys = (1<<0|1<<1|1<<2|1<<3|1<<9)
        show_menu(id, g_Keys, Body, -1, "menu_rod")

        return PLUGIN_CONTINUE
}

public Pressedrod(id, key)
{
        new CsTeams:iTeam = cs_get_user_team(id)

        switch(key)
        {
                case 0:
                {
                        if (iTeam == CS_TEAM_T)
                        {
                                set_user_health(id, 120);
                                client_print(id, print_chat, "VIP > Tau prideta +20HP, dabar HP tu turi 120!")
                        }

                        else if (iTeam == CS_TEAM_CT)
                        {
                                set_user_health(id, 120);
                                client_print(id, print_chat, "VIP > Tau prideta +20HP, dabar HP tu turi 120!")
                        }
                }
               
                case 1:
                {
                        if (iTeam == CS_TEAM_T)
                        {

                        if(is_user_alive(id))
                        {
                                new hp = get_user_health(id);
                               
                                if(hp < 150)
                                {
                                        set_task(15.0,"gyvybes", id);
                                }
                                client_print(id, print_chat, "VIP > Dabar tu, kas 10sec gausi po +10HP!")
                        }

                        else if (iTeam == CS_TEAM_CT)
                        {
                                give_item(id, "weapon_hegrenade");
                                give_item(id, "weapon_flashbang");
                                give_item(id, "weapon_flashbang");
                                client_print(id, print_chat, "VIP > Tu gavai HE ir 2FB granatas!")
                        {
                        }
                        }
                }
                case 2:
                {
                        if (iTeam == CS_TEAM_T)
                        {
                                set_user_armor( id, 250);
                                client_print(id, print_chat, "VIP > Dabar tu turi 250AP!")
                        }

                        else if (iTeam == CS_TEAM_CT)
                        {
                                set_user_armor( id, 250);
                                client_print(id, print_chat, "VIP > Dabar tu turi 250AP!")
                        }
                }
                case 3:
                {
                        if (iTeam == CS_TEAM_T)
                        {
                                set_user_health(id, 100);
                        }       
                        else if (iTeam == CS_TEAM_CT)
                        {
                                if(is_user_alive(id))
                                {
                                        new hp = get_user_health(id);
                               
                                        if(hp < 150)
                                        {
                                                set_task(15.0,"gyvybes", id);
                                        }
                                        client_print(id, print_chat, "VIP > Dabar tu, kas 15sec gausi po +10HP!")
                                }
                        }
                }
                case 9: { //Pabaiga
        }
}
        return PLUGIN_CONTINUE

}

public gyvybes(id) {
       
        new hp = get_user_health(id);
       
        if(hp < 150)
        {
                set_user_health(id, hp + 10);
                set_task(10.0,"gyvybes", id);
        }
        else
        {
                client_print(id, print_chat, "VIP > Daugiau gyvybiu nebegausi, nes pasiekei maximale riba.", hp)
                return PLUGIN_HANDLED;
        }
       
        return PLUGIN_HANDLED;
}

public ShowMotd(id)
{
show_motd(id, "vip.txt")
}
public client_authorized(id)
{
set_task(30.0, "PrintText" ,id)
}
public PrintText(id)
{
client_print(id, print_chat, "[Hide'N'Seek] Rasyk /noriuvip ir pamatysi visas VIP'u privilegijas.")
}

public handle_say(id) {
new said[192]
read_args(said,192)
if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 )
set_task(0.1,"print_adminlist",id)
return PLUGIN_CONTINUE
}

public print_adminlist(user)
{
new adminnames[33][32]
new message[256]
new contactinfo[256], contact[112]
new id, count, x, len

for(id = 1 ; id <= maxplayers ; id++)
if(is_user_connected(id))
if(get_user_flags(id) & ADMIN_LEVEL_H)
get_user_name(id, adminnames[count++], 31)

len = format(message, 255, "%s Prisijunge VIP'ai: ",COLOR)
if(count > 0) {
for(x = 0 ; x < count ; x++) {
len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
if(len > 96 ) {
print_message(user, message)
len = format(message, 255, "%s ",COLOR)
}
}
print_message(user, message)
}
else {
len += format(message[len], 255-len, "Visi VIP'ai atsijunge.")
print_message(user, message)
}

get_cvar_string("amx_contactinfo", contact, 63)
if(contact[0]) {
format(contactinfo, 111, "%s Pgr.Administratoriaus skype: %s", COLOR, contact)
print_message(user, contactinfo)
}
}

print_message(id, msg[]) {
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
write_byte(id)
write_string(msg)
message_end()
}

P.S. There are some lithuania some english Language

Cerise 11-23-2009 10:04

Re: Error in compling
 
You're using AMX and posting into SOURCEMOD that's the first problem :p

bl4nk 11-23-2009 19:51

Re: Error in compling
 
Moved from the SourceMod forums. :up:

YamiKaitou 11-23-2009 22:20

Re: Error in compling
 
PHP Code:

static const CONTACT[] = "Your skype!! 

TO

PHP Code:

static const CONTACT[] = "Your skype!!" 


Also, next time, show us the error messages you get, it is easier on us. Also, pick a coding style and stick with it. Din't put some { at the end of the line and others on a new line. Also, fix your indentation. Looks like you did a bunch of copy and paste

Cola717 11-24-2009 03:36

Re: Error in compling
 
I changed it but now error is biggest [IMG]http://img248.**************/img248/6995/errorpb.jpg[/IMG]

platzpatrone 11-24-2009 03:47

Re: Error in compling
 
well, compile yet.

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
static const COLOR[] = "^x03"
static const CONTACT[] = "Your skype!!"
new maxplayers
new gmsgSayText

public plugin_init()
{
    
register_plugin("HNS Vipas""1.0""by Armasi , Edited by Cola")

    
register_logevent("Round_Start"2"1=Round_Start")
    
register_menucmd(register_menuid("menu_rod"), 1023"Pressedrod")
    
register_clcmd("say /noriuvip","ShowMotd")
    
maxplayers get_maxplayers()
    
gmsgSayText get_user_msgid("SayText")
    
register_clcmd("say""handle_say")
    
register_cvar("amx_contactinfo"CONTACTFCVAR_SERVER)

}

public 
Round_Start()
    
set_task(11.0"Uzdelstas_meniu")
    
public 
Uzdelstas_meniu()
{
    new 
players[32], pnum
    get_players
(playerspnum"a")

    for (new 
0pnumi++)
    {
        new 
player players[i]

        if (
get_user_flags(player) & ADMIN_LEVEL_H)
        {
            
ShowmenuID(player)
        }
    }

    return 
PLUGIN_HANDLED
}

public 
ShowmenuID(id)
{
    new 
Body[512]
    new 
CsTeams:iTeam cs_get_user_team(id)

    if (
iTeam == CS_TEAM_T)
    {
        
add(Body511"\rVIP menu: \R\dB e g l i a m s^n^n")
        
add(Body511"\r1. \w+20HP^n")
        
add(Body511"\r2. \w+10HP/10sec^n")
        
add(Body511"\r3. \w250AP^n")
        
add(Body511"\r0. \wIseiti^n")
    }

    else if (
iTeam == CS_TEAM_CT)
    {
        
add(Body511"\rVIP menu: \R\dS e k l i a m s^n^n")
        
add(Body511"\r1. \w+20HP^n")
        
add(Body511"\r2. \wHE granata^n")
        
add(Body511"\r3. \w250AP^n")
        
add(Body511"\r4. \w+10HP/10sec^n")
        
add(Body511"\r0. \wIseiti^n")
    }

    new 
g_Keys = (1<<0|1<<1|1<<2|1<<3|1<<9)
    
show_menu(idg_KeysBody, -1"menu_rod")

    return 
PLUGIN_CONTINUE
}

public 
Pressedrod(idkey)
{
    new 
CsTeams:iTeam cs_get_user_team(id)

    switch(
key)
    {
        case 
0:
        {
            if (
iTeam == CS_TEAM_T)
            {
                
set_user_health(id120);
                
client_print(idprint_chat"VIP > Tau prideta +20HP, dabar HP tu turi 120!")
            }

            else if (
iTeam == CS_TEAM_CT)
            {
                
set_user_health(id120);
                
client_print(idprint_chat"VIP > Tau prideta +20HP, dabar HP tu turi 120!")
            }
        }
        
        case 
1:
        {
            if (
iTeam == CS_TEAM_T)
            {

            if(
is_user_alive(id))
            {
                new 
hp get_user_health(id);
                
                if(
hp 150)
                {
                    
set_task(15.0,"gyvybes"id);
                }
                
client_print(idprint_chat"VIP > Dabar tu, kas 10sec gausi po +10HP!")
            }

            else if (
iTeam == CS_TEAM_CT)
            {
                
give_item(id"weapon_hegrenade");
                
give_item(id"weapon_flashbang");
                
give_item(id"weapon_flashbang");
                
client_print(idprint_chat"VIP > Tu gavai HE ir 2FB granatas!")
            }
            }

        }
        case 
2:
        {
            if (
iTeam == CS_TEAM_T)
            {
                
set_user_armorid250);
                
client_print(idprint_chat"VIP > Dabar tu turi 250AP!")
            }

            else if (
iTeam == CS_TEAM_CT)
            {
                
set_user_armorid250);
                
client_print(idprint_chat"VIP > Dabar tu turi 250AP!")
            }
        }
        case 
3:
        {
            if (
iTeam == CS_TEAM_T)
            {
                
set_user_health(id100);
            }    
            else if (
iTeam == CS_TEAM_CT)
            {
                if(
is_user_alive(id))
                {
                    new 
hp get_user_health(id);
                
                    if(
hp 150)
                    {
                        
set_task(15.0,"gyvybes"id);
                    }
                    
client_print(idprint_chat"VIP > Dabar tu, kas 15sec gausi po +10HP!")
                }
            }
        }
        case 
9
        { 
//Pabaiga
        
}
    }
    return 
PLUGIN_CONTINUE

}

public 
gyvybes(id) {
    
    new 
hp get_user_health(id);
    
    if(
hp 150)
    {
        
set_user_health(idhp 10);
        
set_task(10.0,"gyvybes"id);
    }
    else
    {
        
client_print(idprint_chat"VIP > Daugiau gyvybiu nebegausi, nes pasiekei maximale riba."hp)
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_HANDLED;
}

public 
ShowMotd(id)
{
show_motd(id"vip.txt")
}
public 
client_authorized(id)
{
set_task(30.0"PrintText" ,id)
}
public 
PrintText(id)
{
client_print(idprint_chat"[Hide'N'Seek] Rasyk /noriuvip ir pamatysi visas VIP'u privilegijas.")
}

public 
handle_say(id) {
new 
said[192]
read_args(said,192)
if( ( 
containi(said"who") != -&& containi(said"admin") != -) || contain(said"/vips") != -)
set_task(0.1,"print_adminlist",id)
return 
PLUGIN_CONTINUE
}

public 
print_adminlist(user)
{
new 
adminnames[33][32]
new 
message[256]
new 
contactinfo[256], contact[112]
new 
idcountxlen

for(id id <= maxplayers id++)
if(
is_user_connected(id))
if(
get_user_flags(id) & ADMIN_LEVEL_H)
get_user_name(idadminnames[count++], 31)

len format(message255"%s Prisijunge VIP'ai: ",COLOR)
if(
count 0) {
for(
count x++) {
len += format(message[len], 255-len"%s%s "adminnames[x], < (count-1) ? ", ":"")
if(
len 96 ) {
print_message(usermessage)
len format(message255"%s ",COLOR)
}
}
print_message(usermessage)
}
else {
len += format(message[len], 255-len"Visi VIP'ai atsijunge.")
print_message(usermessage)
}

get_cvar_string("amx_contactinfo"contact63)
if(
contact[0]) {
format(contactinfo111"%s Pgr.Administratoriaus skype: %s"COLORcontact)
print_message(usercontactinfo)
}
}

print_message(idmsg[]) {
message_begin(MSG_ONEgmsgSayText, {0,0,0}, id)
write_byte(id)
write_string(msg)
message_end()


as YamiKaitou told u to fix your indentations and coding styles, u dont follow him :nono:^^


All times are GMT -4. The time now is 13:42.

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