Raised This Month: $ Target: $400
 0% 

error 048/033 array dimensions/indexed


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
gfxchris
Member
Join Date: Feb 2016
Old 11-12-2020 , 10:20   error 048/033 array dimensions/indexed
Reply With Quote #1

hello,i have this plugin and i cant compile it,i dont know if im in the right section but i want some help with it
error line is 28,and the errors are
Quote:
addon.sma(2 : error 048: array dimensions do not match
addon.sma(2 : error 033: array must be indexed (variable "cvars")
the plugin:
Quote:
#include <amxmodx>
#include <hamsandwich>

native strip_user_weapons(index);

native cs_get_user_hasprim(index);
native cs_get_user_buyzone(index);

new cvars[4];

new const name_cvars[][][] =
{
{"surf_delete_corpse", "1"},
{"surf_buyzone_kill", "0"},
{"surf_superwalls", "1"},
{"surf_strip_sec_weapons", "1"}
}

public plugin_init()
{
register_plugin("Surf Addon", "1.1", "cyby");

RegisterHam(Ham_TakeDamage, "player", "ham_take_damage");
RegisterHam(Ham_TraceAttack, "player", "ham_trace_attack");
RegisterHam(Ham_Killed, "player", "killed_player");

for(new i = 0; i < sizeof name_cvars; i++)
cvars = register_cvar(name_cvars[0], name_cvars[1]);

if(get_pcvar_num(cvars[0]) > 0)
set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET);
}

public ham_take_damage(vic, inf, att, Float:dmg, dmgbits)
{
if(!is_user_alive(att) || att == vic || !is_user_alive(vic))
return HAM_IGNORED;

if(get_pcvar_num(cvars[1]) == 0)
{
if(get_user_team(att) != get_user_team(vic))
{
if(cs_get_user_buyzone(att))
{
client_print(att, print_center, "Nu poti ataca playeri in buy zone!");
return HAM_SUPERCEDE;
}

if(cs_get_user_buyzone(vic))
return HAM_SUPERCEDE;
}
}

if(get_pcvar_num(cvars[2]) > 0)
{
if(!(dmgbits & (1<<1)))
return HAM_IGNORED;

if(!get_isplayer(att))
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}

public ham_trace_attack(vic, att, Float:dmg, Float:vecdr[3], tr, dmgbits)
{
if(!is_user_alive(vic) || !is_user_alive(att))
return HAM_IGNORED;

if(get_pcvar_num(cvars[1]) == 0)
{
if(get_user_team(att) != get_user_team(vic))
{
if(cs_get_user_buyzone(att))
return HAM_SUPERCEDE;

if(cs_get_user_buyzone(vic))
return HAM_SUPERCEDE;
}
}

if(get_pcvar_num(cvars[2]) > 0)
{
if(!(dmgbits & (1<<1)))
return HAM_IGNORED;

if(!get_isplayer(att))
return HAM_SUPERCEDE;
}

return HAM_IGNORED;
}

public killed_player(victim)
{
if(get_pcvar_num(cvars[3]) > 0)
{
if(!is_user_connected(victim))
return HAM_IGNORED;

if(!cs_get_user_hasprim(victim))
strip_user_weapons(victim);
}
return HAM_IGNORED;
}

stock bool:get_isplayer(attacker)
{
new victim, crap;
get_user_aiming(attacker, victim, crap);
if(!is_user_alive(victim))
return false;

return true;
}
gfxchris is offline
 



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 14:06.


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