antiblock
Elveron
  • Chatbox

    Did you check out our Discord? https://discord.gg/FFdvMjk9xA
    You don't have permission to chat.
    Load More
  • 0
Sign in to follow this  
D4rk.

Erro na linha 79

Question

Como o titulo indica tenho um erro aqui na linha 79 e não sei como resolver. Podem dar uma help?

 

  1. #include < amxmisc >
  2. #include < engine >
  3. #include < cstrike >
  4. #include < fun >
  5. #include < fakemeta >
  6. #include < fakemeta_util >
  7. #include < hamsandwich >
  8. #include < csx >
  9.  
  10. #define PLUGIN "AWP 5x5"
  11. #define VERSION "1.0"
  12. #define AUTHOR "Tester"
  13.  
  14. new _mapas_bloquear [][] =
  15. {
  16.     "awp_india2",
  17.     "awp_india"
  18. }
  19.  
  20.  
  21.  
  22. public plugin_init() {
  23.     register_plugin(PLUGIN, VERSION, AUTHOR)
  24.  
  25.     register_clcmd("awp","_cmdawp")
  26.     register_clcmd("magnum","_cmdawp")
  27.     register_clcmd("g3sg1","_cmdawp")
  28.     register_clcmd("d3au1","_cmdawp")
  29.     register_clcmd("sg550","_cmdawp")
  30.     register_clcmd("krieg550","_cmdawp")
  31.     register_clcmd("rebuy","_cmdrebuy")
  32.    
  33.     /// verificar teams nova ronda
  34.     register_event("HLTV", "_nova_ronda", "a", "1=0", "2=0")
  35.     /// verificar teams ao mudar de arma
  36.     register_event("CurWeapon","_verificar_arma","be","1=1");
  37. }
  38.  
  39. public _cmdawp(id)
  40. {
  41.     new equipaT, equipaCT
  42.     new players[32]
  43.  
  44.     get_players(players,equipaT,"e","TERRORIST")
  45.     get_players(players,equipaCT,"e","CT")
  46.    
  47.     if((equipaT < 5) || (equipaCT < 5))
  48.     {
  49.         ColorChat(id,"^4[Manipulation#] ^3AWP's Bloqueadas! ^1So e permitido awp quando as 2 equipas tem 5 ou mais jogadores.")  
  50.         return PLUGIN_HANDLED
  51.     }  
  52.     return PLUGIN_CONTINUE
  53. }
  54.  
  55. public _cmdrebuy(id)
  56. {
  57.     return PLUGIN_HANDLED
  58. }
  59.  
  60. public _nova_ronda(id)
  61. {  
  62.     _verificar_arma(id)
  63.     return PLUGIN_CONTINUE
  64. }
  65.  
  66. public _verificar_arma(id)
  67. {
  68.     new equipaT, equipaCT
  69.     new players[32]
  70.  
  71.     get_players(players,equipaT,"e","TERRORIST")
  72.     get_players(players,equipaCT,"e","CT")
  73.    
  74.     new weapon = get_user_weapon(id)
  75.  
  76.     new _nome_mapa_atual[33]
  77.     get_mapname(_nome_mapa_atual,32)
  78.    
  79.     if( !equal( _nome_mapa_atual, _mapas_bloquear ) )
  80.     {
  81.         if (weapon == CSW_AWP)
  82.         {
  83.             if((equipaT < 5) || (equipaCT < 5))
  84.             {
  85.                 ColorChat(id,"^4[Manipulation#] ^3AWP Removida! ^1So e permitido awp quando as 2 equipas tem 5 ou mais jogadores.")  
  86.                 _tirar_arma(id,"weapon_awp");
  87.                 return PLUGIN_HANDLED
  88.             }
  89.         }
  90.     }
  91.     return PLUGIN_CONTINUE
  92. }
  93.  
  94.  
  95. ///// tirar arma
  96. stock _tirar_arma(id,weapon[])
  97. {
  98.     if(!equal(weapon,"weapon_",7)) return 0;
  99.  
  100.     new wId = get_weaponid(weapon);
  101.     if(!wId) return 0;
  102.  
  103.     new wEnt;
  104.     while((wEnt = engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapon)) && pev(wEnt,pev_owner) != id) {}
  105.     if(!wEnt) return 0;
  106.  
  107.     if(get_user_weapon(id) == wId) ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt);
  108.  
  109.     if(!ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) return 0;
  110.     ExecuteHamB(Ham_Item_Kill,wEnt);
  111.  
  112.     set_pev(id,pev_weapons,pev(id,pev_weapons) & ~(1<<wId));
  113.  
  114.     return 1;
  115. }
  116. ///// ColorChat
  117. stock ColorChat(const id, const input[], any:...)
  118. {
  119.         new count = 1, players[32]
  120.         static msg[191]
  121.         vformat(msg, 190, input, 3)
  122.  
  123.         replace_all(msg, 190, "!g", "^4") // verde
  124.         replace_all(msg, 190, "!y", "^1") // Default
  125.         replace_all(msg, 190, "!team", "^3") // Team
  126.         replace_all(msg, 190, "!team2", "^0") // Team2
  127.  
  128.         if (id) players[0] = id; else get_players(players, count, "ch")
  129.         {
  130.                 for (new i = 0; i < count; i++)
  131.                 {
  132.                         if (is_user_connected(players[i]))
  133.                         {
  134.                                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  135.                                 write_byte(players[i]);
  136.                                 write_string(msg);
  137.                                 message_end();
  138.                         }
  139.                 }
  140.         }
  141. }

Share this post


Link to post
Share on other sites

10 answers to this question

  • 0
if(!equal(_nome_mapa_atual, _mapas_bloquear))

 

Share this post


Link to post
Share on other sites
antiblock
Cyphriun
  • 0

Não funcionou

Share this post


Link to post
Share on other sites
  • 0

do pouco conhecimento que tenho, o nome mapas a bloquear é uma matriz, e o nome mapa atual é um array...

Acho que nao podes comparar dois tipos diferentes

Share this post


Link to post
Share on other sites
  • 0

up

Share this post


Link to post
Share on other sites
  • 0

Atenção que a função equal() esta a dar um return TRUE ou FALSE não pode ser diferente ou seja

  1.  ifequal( _nome_mapa_atual, _mapas_bloquear ) )
  2.  

 

Experimente assim :D

Edited by Dima (see edit history)

Share this post


Link to post
Share on other sites
  • 0

Que parece aqui e do compilador, verifica se tens uma pasta com nome compiled dentro da pasta Compilador11.

Configure o compilador 

 

EDIT:

Depois vi o erro 17 camuflado ehehehe

Edited by Dima
UPDATE (see edit history)

Share this post


Link to post
Share on other sites
  • 0

Não é do compilador, já compilei imensos plugins com ele.. :S

Share this post


Link to post
Share on other sites
  • 0
#include < amxmisc >
#include < engine >
#include < cstrike >
#include < fun >
#include < fakemeta >
#include < fakemeta_util >
#include < hamsandwich >
#include < csx >
 
#define PLUGIN "AWP 5x5"
#define VERSION "1.0"
#define AUTHOR "Tester"
 
new _mapas_bloquear [][] =
{
    "awp_india2",
    "awp_india"
}
 
 
 
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
 
    register_clcmd("awp","_cmdawp")
    register_clcmd("magnum","_cmdawp")
    register_clcmd("g3sg1","_cmdawp")
    register_clcmd("d3au1","_cmdawp")
    register_clcmd("sg550","_cmdawp")
    register_clcmd("krieg550","_cmdawp")
    register_clcmd("rebuy","_cmdrebuy")
   
    /// verificar teams nova ronda
    register_event("HLTV", "_nova_ronda", "a", "1=0", "2=0")
    /// verificar teams ao mudar de arma
    register_event("CurWeapon","_verificar_arma","be","1=1");
}
 
public _cmdawp(id)
{
    new equipaT, equipaCT
    new players[32]
 
    get_players(players,equipaT,"e","TERRORIST")
    get_players(players,equipaCT,"e","CT")
   
    if((equipaT < 5) || (equipaCT < 5))
    {
        ColorChat(id,"^4[Manipulation#] ^3AWP's Bloqueadas! ^1So e permitido awp quando as 2 equipas tem 5 ou mais jogadores.")  
        return PLUGIN_HANDLED
    }  
    return PLUGIN_CONTINUE
}
 
public _cmdrebuy(id)
{
    return PLUGIN_HANDLED
}
 
public _nova_ronda(id)
{  
    _verificar_arma(id)
    return PLUGIN_CONTINUE
}
 
public _verificar_arma(id)
{
    new equipaT, equipaCT
    new players[32]
 
    get_players(players,equipaT,"e","TERRORIST")
    get_players(players,equipaCT,"e","CT")
   
    new weapon = get_user_weapon(id)
 
    new _nome_mapa_atual[33]
    get_mapname(_nome_mapa_atual,32)
   
    if(equali( _nome_mapa_atual[32], _mapas_bloquear[1][2],32 ) )
    {
        if (weapon == CSW_AWP)
        {
            if((equipaT < 5) || (equipaCT < 5))
            {
                ColorChat(id,"^4[Manipulation#] ^3AWP Removida! ^1So e permitido awp quando as 2 equipas tem 5 ou mais jogadores.")  
                _tirar_arma(id,"weapon_awp");
                return PLUGIN_HANDLED
            }
        }
    }
    return PLUGIN_CONTINUE
}
 
 
///// tirar arma
stock _tirar_arma(id,weapon[])
{
    if(!equal(weapon,"weapon_",7)) return 0;
 
    new wId = get_weaponid(weapon);
    if(!wId) return 0;
 
    new wEnt;
    while((wEnt = engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapon)) && pev(wEnt,pev_owner) != id) {}
    if(!wEnt) return 0;
 
    if(get_user_weapon(id) == wId) ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt);
 
    if(!ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) return 0;
    ExecuteHamB(Ham_Item_Kill,wEnt);
 
    set_pev(id,pev_weapons,pev(id,pev_weapons) & ~(1<<wId));
 
    return 1;
}
///// ColorChat
stock ColorChat(const id, const input[], any:...)
{
        new count = 1, players[32]
        static msg[191]
        vformat(msg, 190, input, 3)
 
        replace_all(msg, 190, "!g", "^4") // verde
        replace_all(msg, 190, "!y", "^1") // Default
        replace_all(msg, 190, "!team", "^3") // Team
        replace_all(msg, 190, "!team2", "^0") // Team2
 
        if (id) players[0] = id; else get_players(players, count, "ch")
        {
                for (new i = 0; i < count; i++)
                {
                        if (is_user_connected(players[i]))
                        {
                                message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
                                write_byte(players[i]);
                                write_string(msg);
                                message_end();
                        }
                }
        }
}

aqui esta o código  corrigido :P 

Share this post


Link to post
Share on other sites
  • 0

Agradecido :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this