Русское сообщество по скриптингу

[Help] For error

Scripting help for english speaking users. While not very active, you still have a chance to get help here.
Правила форума
We cannot maintain english version version of our forum rules, but shortly (it's simple) - Don't be a dick. If you really want to know our rules you should check appropriate thread.

[Help] For error

Сообщение VenomIvanof » 04 июн 2016, 11:52

i get this error ..

Код: Выделить всё
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Warning: Loose indentation on line 13
Warning: Loose indentation on line 15
Warning: Loose indentation on line 16
Error: Expected token: ")", but found "{" on line 22
Error: Unmatched closing brace on line 51

2 Errors.
Could not locate output file C:\Users\Venom\Desktop\ammolimit.amx (compile failed).

Код: Выделить всё
#include <amxmodx> 
#include <hamsandwich>
#include <zombieplague> 
#include <fun>

new g_iAPCount[33]
new 
g_iVIPAPLimitg_iAPLimit

public plugin_init() 

    
register_plugin("Simple AP Limit""1.0""zmd94"
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerRespawn"1)
    
    
g_iVIPAPLimit register_cvar("zp_VIP_ammo_limit","1500")
    
g_iAPLimit register_cvar("zp_ammo_limit","700")


public 
fw_PlayerRespawn(id

    if(
is_user_alive(id)
    {
        if(
get_user_flags(id) & ADMIN_LEVEL_H)
        {
            if(
zp_get_user_ammo_packs(id) > get_pcvar_num(g_iVIPAPLimit)) 
            { 
                
g_iAPCount[id] = zp_get_user_ammo_packs(id) - get_pcvar_num(g_iVIPAPLimit)
                
zp_set_user_ammo_packs(idget_pcvar_num(g_iVIPAPLimit))
                
                
set_user_health(idget_user_health(id) + g_iAPCount[id])
                
client_print(idprint_chat"[ZP] AP limit is reached. AP is being convert to free %i HP!"g_iAPCount[id]) 
                
                
g_iAPCount[id] = 0
            

        }
        else
        {
            if(
zp_get_user_ammo_packs(id) > get_pcvar_num(g_iAPLimit)) 
            { 
                
g_iAPCount[id] = zp_get_user_ammo_packs(id) - get_pcvar_num(g_iAPLimit)
                
zp_set_user_ammo_packs(idget_pcvar_num(g_iAPLimit))
                
                
set_user_health(idget_user_health(id) + g_iAPCount[id])
                
client_print(idprint_chat"[ZP] AP limit is reached. AP is being convert to free %i HP!"g_iAPCount[id]) 
                
                
g_iAPCount[id] = 0
            

        }
    }
Аватара пользователя
VenomIvanof
 
Сообщения: 62
Зарегистрирован: 02 апр 2016, 13:26
Благодарил (а): 17 раз.
Поблагодарили: 1 раз.
Языки программирования: Counter-Strike 1.6

Re: [Help] For error

Сообщение ChewBacca » 04 июн 2016, 12:56

Just you put to many braces in the end, and some miss..

Код: Выделить всё
#include <amxmodx> 
#include <hamsandwich>
#include <zombieplague> 
#include <fun>

new g_iAPCount[33]
new g_iVIPAPLimit, g_iAPLimit

public plugin_init
() 
{ 
    register_plugin
("Simple AP Limit", "1.0", "zmd94") 

    RegisterHam
(Ham_Spawn, "player", "fw_PlayerRespawn", 1)
    
    g_iVIPAPLimit 
= register_cvar("zp_VIP_ammo_limit","1500")
    g_iAPLimit = register_cvar("zp_ammo_limit","700")
}
 

public fw_PlayerRespawn
(id) 
{ 
    if
(is_user_alive(id))
    {
        if(get_user_flags(id) & ADMIN_LEVEL_H)
        {
            if(zp_get_user_ammo_packs(id) > get_pcvar_num(g_iVIPAPLimit)) 
            
{ 
                g_iAPCount
[id] = zp_get_user_ammo_packs(id) - get_pcvar_num(g_iVIPAPLimit)
                zp_set_user_ammo_packs(id, get_pcvar_num(g_iVIPAPLimit))
            
                set_user_health
(id, get_user_health(id) + g_iAPCount[id])
                client_print(id, print_chat, "[ZP] AP limit is reached. AP is being convert to free %i HP!", g_iAPCount[id]) 
            
                g_iAPCount
[id] = 0
            
} 
        
}
        else
        if
(zp_get_user_ammo_packs(id) > get_pcvar_num(g_iAPLimit)) 
        
{ 
            g_iAPCount
[id] = zp_get_user_ammo_packs(id) - get_pcvar_num(g_iAPLimit)
            zp_set_user_ammo_packs(id, get_pcvar_num(g_iAPLimit))
            
            set_user_health
(id, get_user_health(id) + g_iAPCount[id])
            client_print(id, print_chat, "[ZP] AP limit is reached. AP is being convert to free %i HP!", g_iAPCount[id]) 
            
            g_iAPCount
[id] = 0
        
}         
    
}
}
 
Аватара пользователя
ChewBacca
 
Сообщения: 17
Зарегистрирован: 17 окт 2013, 18:34
Благодарил (а): 5 раз.
Поблагодарили: 5 раз.
Языки программирования: Counter-Strike 1.6


Вернуться в Scripting

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1