1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264. | #include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#define PLUGIN "Call of Duty Aim"
#define VERSION "1.6"
#define AUTHOR "DarkGL & MMYTH"
#define TIME 0.4
#define MAX_SIZE_ID 33
new bool:is_friend[MAX_SIZE_ID], bool:is_accept[MAX_SIZE_ID], szColor[MAX_SIZE_ID][12];
new g_hit,g_steam,g_standard,g_off,g_damage;
new SyncHudMsg;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_Spawn,"player","ham_spawned");
g_hit = register_cvar("cod_aim_showhit", "1");
g_steam = register_cvar("cod_aim_steam","1");
g_standard = register_cvar("cod_aim_on","1");
g_off = register_cvar("cod_aim_can_off","1");
g_damage = register_cvar("cod_aim_on_damage","0");
register_clcmd("say /cod_aim", "clcmd_cod_aim");
register_clcmd("say /cod_color","clcmd_cod_color");
register_clcmd("aim_color","aim_color");
register_event("Damage", "event_damage", "b", "2!=0")
register_event("StatusValue", "event_statusvalue_team", "be", "1=1");
register_event("StatusValue", "event_status_value", "be", "1=2", "2!0");
register_event("StatusValue", "event_statusvalue_hide", "be", "1=1", "2=0");
SyncHudMsg = CreateHudSyncObj();
register_dictionary("cod_aim.txt");
}
public aim_color(id){
new szCommand[256];
read_args(szCommand,charsmax(szCommand));
remove_quotes(szCommand);
if(checkString(szCommand)){
copy(szColor[id],11,szCommand);
CallofDutyAim(id,szColor[id]);
client_print(id, print_chat, "[Call of Duty Aim] %L", id,"MSG_AIM_GOOD_COLOR");
}
else{
client_print(id, print_chat, "[Call of Duty Aim] %L !", id,"MSG_AIM_WRONG_COLOR");
}
}
public bool:checkString(szCommand[]){
for(new i = 0;i<strlen(szCommand);i++){
if(isalpha(szCommand[i])){
return false;
}
}
return true;
}
public ham_spawned(id){
if(!is_user_alive(id)){
return HAM_IGNORED;
}
if(!get_pcvar_num(g_steam) && equal(szColor[id],"") && get_pcvar_num(g_standard)){
is_accept[id] = false;
createMenu(id);
}
return HAM_IGNORED;
}
public clcmd_cod_color(id){
createMenu(id);
}
public createMenu(id){
new szTmp[256];
formatex(szTmp,charsmax(szTmp),"\rCall of Duty Aim^n\w%L",id,"MSG_AIM_TITLE");
new menu = menu_create(szTmp,"menuHandle");
formatex(szTmp,255,"%L",id,"MSG_AIM_GREEN");
menu_additem(menu,szTmp);
formatex(szTmp,255,"%L",id,"MSG_AIM_RED");
menu_additem(menu,szTmp);
formatex(szTmp,255,"%L",id,"MSG_AIM_BLUE");
menu_additem(menu,szTmp);
formatex(szTmp,255,"%L",id,"MSG_AIM_YELLOW");
menu_additem(menu,szTmp);
formatex(szTmp,255,"%L",id,"MSG_AIM_LTBLUE");
menu_additem(menu,szTmp);
formatex(szTmp,255,"%L",id,"MSG_AIM_OTHER");
menu_additem(menu,szTmp);
menu_setprop(menu, MPROP_NUMBER_COLOR, "\y");
menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER);
menu_display(id,menu);
}
public menuHandle(id,menu,item){
switch(item){
case 0:
{
format(szColor[id],11,"0 255 0");
}
case 1:
{
format(szColor[id],11,"255 0 0");
}
case 2:
{
format(szColor[id],11,"0 0 255");
}
case 3:
{
format(szColor[id],11,"250 250 50");
}
case 4:
{
format(szColor[id],11,"50 250 250");
}
case 5:
{
client_cmd(id,"messagemode aim_color");
}
}
is_accept[id] = true;
CallofDutyAim(id, szColor[id]);
menu_destroy(menu);
}
public client_connect(id)
{
is_accept[id] = false;
format(szColor[id],11,"");
if(!is_user_bot(id)){
if(get_pcvar_num(g_standard))
is_accept[id] = true;
client_cmd(id,"adjust_crosshair")
}
}
public clcmd_cod_aim(id)
{
if(!get_pcvar_num(g_off)){
return PLUGIN_CONTINUE;
}
is_accept[id] = !is_accept[id];
client_print(id, print_chat, "[Call of Duty Aim] %L", id,is_accept[id] ? "MSG_AIM_ON" : "MSG_AIM_OFF");
if(equal(szColor[id],"")){
createMenu(id);
}
else{
CallofDutyAim(id, szColor[id]);
}
return PLUGIN_CONTINUE;
}
public event_damage(id)
{
if(!is_user_connected(id))
return PLUGIN_CONTINUE;
new attacker = get_user_attacker(id);
if(!is_user_connected(attacker) || id == attacker)
return PLUGIN_CONTINUE;
new teamId = get_user_team(id);
new teamAt = get_user_team(attacker);
if(get_pcvar_num(g_hit) && is_accept[attacker] && teamId == teamAt)
{
set_hudmessage(170, 255, 255, -1.0, -1.0, 0, 2.0, 2.0);
ShowSyncHudMsg(attacker, SyncHudMsg, "X");
}
if(get_pcvar_num(g_damage) && is_accept[attacker] && teamId == teamAt){
if(equal(szColor[attacker],"50 250 50"))
CallofDutyAim(attacker, "255 255 0");
else
CallofDutyAim(attacker, "50 250 50");
remove_task(attacker);
set_task(TIME,"offAim",attacker);
}
else if(get_pcvar_num(g_damage) && is_accept[attacker] && teamId != teamAt){
if(equal(szColor[attacker],"255 0 0"))
CallofDutyAim(attacker, "255 255 0");
else
CallofDutyAim(attacker, "255 0 0");
remove_task(attacker);
set_task(TIME,"offAim",attacker);
}
return PLUGIN_CONTINUE;
}
public offAim(id){
if(!equal(szColor[id],"")){
CallofDutyAim(id,szColor[id]);
}
}
public event_statusvalue_team(id)
{
if(!is_user_bot(id) && is_user_connected(id) && is_accept[id] && !get_pcvar_num(g_damage))
{
is_friend[id] = (read_data(2) == 1) ? true : false;
}
}
public event_status_value(id)
{
if(!is_user_bot(id) && is_user_connected(id) && is_accept[id] && !get_pcvar_num(g_damage))
{
if(is_friend[id])
{
if(equal(szColor[id],"50 250 50"))
CallofDutyAim(id, "255 255 0");
else
CallofDutyAim(id, "50 250 50");
}
else
{
if(equal(szColor[id],"255 0 0"))
CallofDutyAim(id, "255 255 0");
else
CallofDutyAim(id, "255 0 0");
}
}
}
public event_statusvalue_hide(id)
{
if(!is_user_bot(id) && is_user_connected(id) && is_accept[id] && !get_pcvar_num(g_damage))
{
CallofDutyAim(id, szColor[id]);
}
}
CallofDutyAim(id, color[])
{
if(is_user_connected(id))
client_cmd(id, "cl_crosshair_color ^"%s^"", color);
}
|