Код:
new Float:Graffiti_Drawing_Second[MAX_PLAYERS] , Graffiti_Colour[MAX_PLAYERS] , Graffiti_Symbol[MAX_PLAYERS] , Menu_Status[MAX_PLAYERS] , ent_Menu[MAX_PLAYERS]
Why MAX_PLAYERS? It should be MAX_PLAYERS+1 because the maximum number of players is 32 players, not 31. Without changing it, you'll get an error when you'll try to do something with player ID 32.
----------------------------------
Код:
#define GRAFFITI_SOUND "Grafiti_Print.wav"
#define GRAFFITI_MODEL "sprites/CsgoGraffiti.spr"
Change it to
new const[] = "";
Explanation here:
https://forums.alliedmods.net/showpost.php?p=1483739&postcount=2
----------------------------------
Код:
cvar_graffiti_reload_time = get_pcvar_float(register_cvar("graffiti_reload_time","45"))
cvar_graffiti_visibility_time = get_pcvar_float(register_cvar("graffiti_visibility_time","25"))
cvar_graffiti_fade_away_time = get_pcvar_float(register_cvar("graffiti_fade_away_time","30"))
cvar_graffiti_distance = get_pcvar_float(register_cvar("graffiti_distance","150.0"))
Since the compatibility is with AMXX 1.9.0. or higher, you should use
create_cvar +
bind_pcvar_float.
----------------------------------
Just an advice, don't write in the same line, it's difficult to read code like this:
Код:
if ( Graffiti_Colour[id] < 0 ) Graffiti_Colour[id] = Grafiti_Max_Colour_Client + 1
else if ( Graffiti_Colour[id] > Grafiti_Max_Colour_Client + 1 ) Graffiti_Colour[id] = 0
----------------------------------
Код:
entity_set_string(MODEL_ent, EV_SZ_classname, "CSGO_Grafiti" );
entity_set_vector(MODEL_ent, EV_VEC_angles, Angles ) ;
Why aren't you using ReAPI here (just an example, there are more in the code like this)?
----------------------------------
Код:
public overflow_graffiti_detect(Float:i_Origin[3], Float:i_Angles[3], Float:vNormal[3]){
public Spawn_in_wall_detect(Float:Origin[3],Float:Angles[3]){
public create_menu_entity(id){
Why do you add
public
to functions that shouldn't be public? These are just examples, there are more like this.
----------------------------------
Код:
Colour[0] = g_Colors[Graffiti_Colour[id]][0]
Colour[1] = g_Colors[Graffiti_Colour[id]][1]
Colour[2] = g_Colors[Graffiti_Colour[id]][2]
You can use
xs_vec_copy
----------------------------------
Код:
Colour[0] = 255.0 , Colour[1] = 255.0 , Colour[2] = 255.0
You can use
xs_vec_set
----------------------------------
Код:
-Menu_Status[id] += 1
-Menu_Status[id] -= 1
+Menu_Status[id]++;
+Menu_Status[id]--;