Parent Directory | Revision Log
Revision 25 - (view) (download)
1 : | ian | 1 | /* |
2 : | ian | 25 | All In One v0.7.32 |
3 : | Copyright (C) 2005-2007 Ian (Juan) Cammarata | ||
4 : | |||
5 : | This program is free software: you can redistribute it and/or modify | ||
6 : | it under the terms of the GNU Affero General Public License as | ||
7 : | published by the Free Software Foundation, either version 3 of the | ||
8 : | License, or (at your option) any later version. | ||
9 : | |||
10 : | This program is distributed in the hope that it will be useful, | ||
11 : | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 : | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 : | GNU Affero General Public License for more details. | ||
14 : | |||
15 : | You should have received a copy of the GNU Affero General Public License | ||
16 : | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 : | -------------------------------------------------------------------------------- | ||
18 : | http://ian.cammarata.us | ||
19 : | |||
20 : | To Do: | ||
21 : | |||
22 : | ian | 1 | */ |
23 : | |||
24 : | #include <amxmodx> | ||
25 : | #include <fun> | ||
26 : | #include <amxmisc> | ||
27 : | #include <engine> | ||
28 : | #include <cstrike> | ||
29 : | #include <cstrike2> | ||
30 : | #include <lib_targets> | ||
31 : | |||
32 : | //Fun Compile | ||
33 : | #define WCALT ADMIN_RESERVATION | ||
34 : | //Normal Compile | ||
35 : | //#define WCALT ADMIN_RCON | ||
36 : | |||
37 : | new bombtargent=0 | ||
38 : | new playersteam[32],bool:teamschanged=false | ||
39 : | new playerspeed[32],bool:b_fly[32] | ||
40 : | |||
41 : | public aio_noclip(id,level,cid){ | ||
42 : | if(cmd_access(id,level,cid,2)){ | ||
43 : | new targets[32],targnum=0 | ||
44 : | targets=targets_find(id,targnum,ALIVE+NOBOT,_,WCALT) | ||
45 : | if(targnum){ | ||
46 : | new val=0,arg[2] | ||
47 : | if(read_argc()>2){ | ||
48 : | read_argv(2,arg,sizeof(arg)-1) | ||
49 : | if(!equal(arg,"0"))val=1 | ||
50 : | } | ||
51 : | for(new i=0;i<targnum;i++)set_user_noclip(targets[i],val) | ||
52 : | if(id!=0)if(id!=0)targets_activity(id,targets,targnum,val==1?"noclip enabled":"noclip disabled") | ||
53 : | } | ||
54 : | } | ||
55 : | return PLUGIN_HANDLED | ||
56 : | } | ||
57 : | public aio_fly(id,level,cid){ | ||
58 : | if(cmd_access(id,level,cid,2)){ | ||
59 : | new targets[32],targnum=0 | ||
60 : | targets=targets_find(id,targnum,0,_,WCALT) | ||
61 : | if(targnum){ | ||
62 : | new bool:val=false,arg[2] | ||
63 : | if(read_argc()>2){ | ||
64 : | read_argv(2,arg,sizeof(arg)-1) | ||
65 : | if(!equal(arg,"0"))val=true | ||
66 : | } | ||
67 : | for(new i=0;i<targnum;i++){ | ||
68 : | b_fly[targets[i]]=val | ||
69 : | set_user_gravity(targets[i],val?-0.04:1.0) | ||
70 : | } | ||
71 : | if(id!=0)targets_activity(id,targets,targnum,val?"fly enabled":"fly disabled") | ||
72 : | } | ||
73 : | } | ||
74 : | return PLUGIN_HANDLED | ||
75 : | } | ||
76 : | public aio_godmode(id,level,cid){ | ||
77 : | if(cmd_access(id,level,cid,2)){ | ||
78 : | new targets[32],targnum=0 | ||
79 : | targets=targets_find(id,targnum,ALIVE,_,WCALT) | ||
80 : | if(targnum){ | ||
81 : | new val=0,arg[2] | ||
82 : | if(read_argc()>2){ | ||
83 : | read_argv(2,arg,sizeof(arg)-1) | ||
84 : | if(!equal(arg,"0"))val=1 | ||
85 : | } | ||
86 : | for(new i=0;i<targnum;i++)set_user_godmode(targets[i],val) | ||
87 : | if(id!=0)targets_activity(id,targets,targnum,val==1?"god mode enabled":"god mode disabled") | ||
88 : | } | ||
89 : | } | ||
90 : | return PLUGIN_HANDLED | ||
91 : | } | ||
92 : | public clexec(id,level,cid){ | ||
93 : | if(cmd_access(id,level,cid,3)){ | ||
94 : | new targets[32],targnum=0,trimlen=0,arg[100] | ||
95 : | targets=targets_find(id,targnum,IMMUNITY+LEVEL,_,WCALT) | ||
96 : | if(targnum){ | ||
97 : | read_argv(1,arg,sizeof(arg)) | ||
98 : | trimlen+=strlen(arg)+1 | ||
99 : | read_args(arg,sizeof(arg)) | ||
100 : | for(new i=0;i<targnum;i++)client_cmd(targets[i],arg[trimlen]) | ||
101 : | new cmdname[21] | ||
102 : | format(cmdname,sizeof(cmdname)-1,"exec ^"%s^"",arg[trimlen]) | ||
103 : | if(id!=0)targets_activity(id,targets,targnum,cmdname) | ||
104 : | } | ||
105 : | } | ||
106 : | return PLUGIN_HANDLED | ||
107 : | } | ||
108 : | public gravity(id,level,cid){ | ||
109 : | if(cmd_access(id,level,cid,3)){ | ||
110 : | new targets[32],targnum=0,arg[8],Float:grav | ||
111 : | targets=targets_find(id,targnum,ALIVE,_,WCALT) | ||
112 : | if(targnum){ | ||
113 : | read_argv(2,arg,sizeof(arg)) | ||
114 : | grav=strtonum(arg)*0.01 | ||
115 : | for(new i=0;i<targnum;i++)set_user_gravity(targets[i],grav) | ||
116 : | new cmdname[21] | ||
117 : | format(cmdname,sizeof(cmdname)-1,"gravity %d/100",strtonum(arg)) | ||
118 : | if(id!=0)targets_activity(id,targets,targnum,cmdname) | ||
119 : | } | ||
120 : | } | ||
121 : | return PLUGIN_HANDLED | ||
122 : | } | ||
123 : | /*public pspawn(id,level,cid){ | ||
124 : | if(cmd_access(id,level,cid,2)){ | ||
125 : | new targets[32],targnum | ||
126 : | targets=targets_find(id,targnum,DEAD,_,WCALT) | ||
127 : | if(targnum){ | ||
128 : | for(new i=0;i<targnum;i++)cs_user_spawn(targets[i]) | ||
129 : | if(id!=0)targets_activity(id,targets,targnum) | ||
130 : | } | ||
131 : | } | ||
132 : | return PLUGIN_HANDLED | ||
133 : | }*/ | ||
134 : | public speed(id,level,cid){ | ||
135 : | if(cmd_access(id,level,cid,3)){ | ||
136 : | new targets[32],targnum=0,arg[8] | ||
137 : | targets=targets_find(id,targnum,0,_,WCALT) | ||
138 : | if(targnum){ | ||
139 : | read_argv(2,arg,sizeof(arg)) | ||
140 : | //for(new i=0;i<targnum;i++)entity_set_float(targets[i],EV_FL_maxspeed,floatstr(arg)) | ||
141 : | for(new i=0;i<targnum;i++)playerspeed[targets[i]]=str_to_num(arg) | ||
142 : | new cmdname[21] | ||
143 : | format(cmdname,sizeof(cmdname)-1,"speed %d",strtonum(arg)) | ||
144 : | if(id!=0)targets_activity(id,targets,targnum,cmdname) | ||
145 : | } | ||
146 : | } | ||
147 : | return PLUGIN_HANDLED | ||
148 : | } | ||
149 : | public client_PreThink(id){ | ||
150 : | if(b_fly[id]){ | ||
151 : | new Float:dvec[3]={0.0,0.0,0.0},btns=entity_get_int(id,EV_INT_button) | ||
152 : | if(btns&IN_FORWARD||btns&IN_BACK){ | ||
153 : | velocity_by_aim(id,floatround(entity_get_float(id,EV_FL_maxspeed)*2),dvec) | ||
154 : | if(btns&IN_BACK){ | ||
155 : | dvec[0]*=-1 | ||
156 : | dvec[1]*=-1 | ||
157 : | dvec[2]*=-1 | ||
158 : | } | ||
159 : | } | ||
160 : | entity_set_vector(id,EV_VEC_velocity,dvec) | ||
161 : | } | ||
162 : | if(playerspeed[id]>0){ | ||
163 : | new btns=entity_get_int(id,EV_INT_button),Float:dvec[3] | ||
164 : | entity_get_vector(id,EV_VEC_velocity,dvec) | ||
165 : | if(dvec[2]==0.0&&(btns&IN_FORWARD||btns&IN_BACK)&&(!(btns&IN_RUN)&&!(btns&IN_DUCK))){ | ||
166 : | new Float:tvec[3]//,Float:lvec[3] | ||
167 : | new Float:mspeed=entity_get_float(id,EV_FL_maxspeed) | ||
168 : | //entity_get_vector(id,EV_VEC_angles,lvec) | ||
169 : | velocity_by_aim(id,floatround(mspeed),tvec) | ||
170 : | //if(dvec[0]!=0.0&&dvec[1]!=0.0)client_print(id,print_console,"dx:%f dy:%f dmax:%f ly:%f tx:%f ty:%f",dvec[0],dvec[1],mspeed,lvec[1],tvec[0],tvec[1]) | ||
171 : | if(btns&IN_BACK){ | ||
172 : | tvec[0]*=-1 | ||
173 : | tvec[1]*=-1 | ||
174 : | } | ||
175 : | /*else if(btns&IN_MOVELEFT){ | ||
176 : | } | ||
177 : | else if(btns&IN_MOVERIGHT){ | ||
178 : | }*/ | ||
179 : | dvec[0]=tvec[0]*playerspeed[id] | ||
180 : | dvec[1]=tvec[1]*playerspeed[id] | ||
181 : | entity_set_vector(id,EV_VEC_velocity,dvec) | ||
182 : | } | ||
183 : | } | ||
184 : | } | ||
185 : | public slay(id,level,cid){ | ||
186 : | if(cmd_access(id,level,cid,2)){ | ||
187 : | new targets[32],targnum=0 | ||
188 : | targets=targets_find(id,targnum,ALIVE+IMMUNITY+SELF,_,WCALT) | ||
189 : | if(targnum)for(new i=0;i<targnum;i++)user_kill(targets[i]) | ||
190 : | targets_activity(id,targets,targnum,_,id==0?0:-1) | ||
191 : | } | ||
192 : | return PLUGIN_HANDLED | ||
193 : | } | ||
194 : | /*public headshot(id,level,cid){ | ||
195 : | if(cmd_access(id,level,cid,2)){ | ||
196 : | new targets[32],targnum=0,arg[24] | ||
197 : | targets=targets_find(id,targnum,ALIVE+IMMUNITY+SELF,_,WCALT) | ||
198 : | if(targnum){ | ||
199 : | read_argv(2,arg,sizeof(arg)) | ||
200 : | for(new i=0;i<targnum;i++)client_death(targets[i],id,arg,1) | ||
201 : | if(id!=0)targets_activity(id,targets,targnum) | ||
202 : | } | ||
203 : | } | ||
204 : | return PLUGIN_HANDLED | ||
205 : | }*/ | ||
206 : | public give(id,level,cid){ | ||
207 : | if(cmd_access(id,level,cid,3)){ | ||
208 : | new arg[24] | ||
209 : | read_argv(2,arg,sizeof(arg)-1) | ||
210 : | strtolower(arg) | ||
211 : | if(!equal(arg,"item_airtank")){ | ||
212 : | new targets[32],targnum=0 | ||
213 : | targets=targets_find(id,targnum,ALIVE,_,WCALT) | ||
214 : | if(targnum){ | ||
215 : | new strip=0,qty=1 | ||
216 : | for(new i=3;i<read_argc();i++){ | ||
217 : | new tmp[7] | ||
218 : | read_argv(i,tmp,sizeof(tmp)-1) | ||
219 : | if(strip==0){ | ||
220 : | if(equali(tmp,"-strip"))strip=1 | ||
221 : | if(equali(tmp,"-knife"))strip=2 | ||
222 : | } | ||
223 : | if(qty==1&&equali(tmp,"-q",2)){ | ||
224 : | qty=strtonum(tmp[2])>1?strtonum(tmp[2]):1 | ||
225 : | } | ||
226 : | } | ||
227 : | for(new i=0;i<targnum;i++){ | ||
228 : | if(strip>0)weaponstrip(targets[i],strip==1?1:0) | ||
229 : | new tid=targets[i] | ||
230 : | if(equal(arg,"item_nvg"))cs_set_user_nvg(id) | ||
231 : | else if(equal(arg,"item_shield"))cs_set_user_shield(tid,1) | ||
232 : | else if(equal(arg,"item_sodacan"))set_user_health(tid,get_user_health(tid)+(1*qty)<=100?get_user_health(tid)+(1*qty):100) | ||
233 : | else if(equal(arg,"item_healthkit"))set_user_health(tid,get_user_health(tid)+(15*qty)<=100?get_user_health(tid)+(15*qty):100) | ||
234 : | else if(equal(arg,"weapon_flashbang")){ | ||
235 : | give_item(tid,arg) | ||
236 : | if(qty>1)set_pdata_int(tid,387,qty) | ||
237 : | } | ||
238 : | else if(equal(arg,"weapon_hegrenade")){ | ||
239 : | give_item(tid,arg) | ||
240 : | if(qty>1)set_pdata_int(tid,388,qty) | ||
241 : | } | ||
242 : | else if(equal(arg,"weapon_smokegrenade")){ | ||
243 : | give_item(tid,arg) | ||
244 : | if(qty>1)set_pdata_int(tid,389,qty) | ||
245 : | } | ||
246 : | else for(new j=0;j<clamp(qty,1,7);j++)give_item(tid,arg) | ||
247 : | } | ||
248 : | if(equal(arg,"weapon_",7))format(arg,sizeof(arg)-1,arg[7]) | ||
249 : | if(equal(arg,"item_",5))format(arg,sizeof(arg)-1,arg[5]) | ||
250 : | new cmdname[21] | ||
251 : | format(cmdname,sizeof(cmdname)-1,"give qty-%d %s",qty,arg) | ||
252 : | if(id!=0)targets_activity(id,targets,targnum,cmdname) | ||
253 : | } | ||
254 : | } | ||
255 : | else client_print(id,print_console,"[AMX] %s is an ivalid item.",arg) | ||
256 : | } | ||
257 : | return PLUGIN_HANDLED | ||
258 : | } | ||
259 : | public wpnlist(id){ | ||
260 : | client_print(id,print_console,"Weapon list for amx_give command (precede weapon name with ^"weapon_^"):") | ||
261 : | client_print(id,print_console,"^tPistols: glock18, usp, p228, deagle, elite, fiveseven") | ||
262 : | client_print(id,print_console,"^tShotguns: m3, xm1014") | ||
263 : | client_print(id,print_console,"^tSMGs: mac10, tmp, mp5navy, ump45, p90") | ||
264 : | client_print(id,print_console,"^tRifles: galil, famas, ak47, m4a1, sg552, aug") | ||
265 : | client_print(id,print_console,"^tSnipers: scout, awp, g3sg1, sg550") | ||
266 : | client_print(id,print_console,"^tMGs: m249") | ||
267 : | client_print(id,print_console,"^tOther: knife, hegrenade, flashbang, smokegrenade, c4 (bomb)") | ||
268 : | return PLUGIN_HANDLED | ||
269 : | } | ||
270 : | public itemlist(id){ | ||
271 : | client_print(id,print_console,"Item list for amx_give command (precede item name with ^"item_^"):") | ||
272 : | client_print(id,print_console,"^tHealth: healthkit (15hp), sodacan (1hp)") | ||
273 : | client_print(id,print_console,"^tArmor: assaultsuit (kevlar+helm), kevlar, battery (15ap)") | ||
274 : | client_print(id,print_console,"^tMisc: thighpack (Defuse Kit), longjump") | ||
275 : | client_print(id,print_console,"^tUnknown (Probably do nothing.): antidote, security, suit") | ||
276 : | return PLUGIN_HANDLED | ||
277 : | } | ||
278 : | public slap(id,level,cid){ | ||
279 : | if(cmd_access(id,level,cid,2)){ | ||
280 : | new targets[32],targnum=0,arg[5] | ||
281 : | targets=targets_find(id,targnum,ALIVE+IMMUNITY+SELF,_,WCALT) | ||
282 : | if(targnum){ | ||
283 : | read_argv(2,arg,sizeof(arg)) | ||
284 : | for(new i=0;i<targnum;i++)user_slap(targets[i],strtonum(arg)) | ||
285 : | new cmdname[21] | ||
286 : | format(cmdname,sizeof(cmdname)-1,"slap (%d damage)",strtonum(arg)) | ||
287 : | if(id!=0)targets_activity(id,targets,targnum,cmdname) | ||
288 : | } | ||
289 : | } | ||
290 : | return PLUGIN_HANDLED | ||
291 : | } | ||
292 : | public motd(id){ | ||
293 : | show_motd(id,"motd.txt") | ||
294 : | return PLUGIN_HANDLED | ||
295 : | } | ||
296 : | public slashme(id){ | ||
297 : | if(get_cvar_num("amx_slashme")){ | ||
298 : | new msg[100] | ||
299 : | read_args(msg,sizeof(msg)) | ||
300 : | if(equali(msg,"^"/me ",5)){ | ||
301 : | new name[32] | ||
302 : | get_user_name(id,name,sizeof(name)) | ||
303 : | copy(msg,strlen(msg)-6,msg[5]) | ||
304 : | client_print(0,print_chat,"* %s %s *",name,msg) | ||
305 : | return PLUGIN_HANDLED | ||
306 : | } | ||
307 : | } | ||
308 : | return PLUGIN_CONTINUE | ||
309 : | } | ||
310 : | public forcet(id,level,cid){ | ||
311 : | if(cmd_access(id,level,cid,2)){ | ||
312 : | new targets[32],targnum=0 | ||
313 : | targets=targets_find(id,targnum,0,_,WCALT) | ||
314 : | if(targnum){ | ||
315 : | //for(new i=0;i<targnum;i++)set_user_team(targets[i],1) | ||
316 : | if(targnum)for(new i=0;i<targnum;i++)playersteam[targets[i]]=1 | ||
317 : | teamschanged=true | ||
318 : | //if(id!=0)targets_activity(id,targets,targnum) | ||
319 : | } | ||
320 : | } | ||
321 : | return PLUGIN_HANDLED | ||
322 : | } | ||
323 : | public forcect(id,level,cid){ | ||
324 : | if(cmd_access(id,level,cid,2)){ | ||
325 : | new targets[32],targnum=0 | ||
326 : | targets=targets_find(id,targnum,0,_,WCALT) | ||
327 : | if(targnum){ | ||
328 : | //if(targnum)for(new i=0;i<targnum;i++)set_user_team(targets[i],2) | ||
329 : | if(targnum)for(new i=0;i<targnum;i++)playersteam[targets[i]]=2 | ||
330 : | teamschanged=true | ||
331 : | //if(id!=0)targets_activity(id,targets,targnum) | ||
332 : | } | ||
333 : | } | ||
334 : | return PLUGIN_HANDLED | ||
335 : | } | ||
336 : | public forcespec(id,level,cid){ | ||
337 : | if(cmd_access(id,level,cid,2)){ | ||
338 : | new targets[32],targnum=0 | ||
339 : | targets=targets_find(id,targnum,0,_,WCALT) | ||
340 : | if(targnum){ | ||
341 : | //if(targnum)for(new i=0;i<targnum;i++)set_user_team(targets[i],3) | ||
342 : | if(targnum)for(new i=0;i<targnum;i++)playersteam[targets[i]]=3 | ||
343 : | teamschanged=true | ||
344 : | if(id!=0)targets_activity(id,targets,targnum) | ||
345 : | } | ||
346 : | } | ||
347 : | return PLUGIN_HANDLED | ||
348 : | } | ||
349 : | public teamswap(id,level,cid){ | ||
350 : | if(cmd_access(id,level,cid,2)){ | ||
351 : | new targets[32],targnum=0 | ||
352 : | targets=targets_find(id,targnum,0,_,WCALT) | ||
353 : | if(targnum){ | ||
354 : | for(new i=0;i<targnum;i++){ | ||
355 : | new tid=targets[i] | ||
356 : | if(get_user_team(tid)==1)playersteam[tid]=2 | ||
357 : | else if(get_user_team(tid)==2)playersteam[tid]=1 | ||
358 : | } | ||
359 : | teamschanged=true | ||
360 : | if(id!=0)targets_activity(id,targets,targnum) | ||
361 : | } | ||
362 : | } | ||
363 : | return PLUGIN_HANDLED | ||
364 : | } | ||
365 : | public plantanywhere(id,level,cid){ | ||
366 : | if(cmd_access(id,level,cid,1)){ | ||
367 : | new targets[32],targnum=0 | ||
368 : | targets=targets_find(id,targnum,ALIVE,_,WCALT) | ||
369 : | if(targnum){ | ||
370 : | for(new i=0;i<targnum;i++)cs_set_user_plant(targets[i]) | ||
371 : | //set_offset_int(targets[i],193,(1<<8)) | ||
372 : | if(id!=0)targets_activity(id,targets,targnum) | ||
373 : | } | ||
374 : | if(!bombtargent){ | ||
375 : | new ent=create_entity("func_bomb_target") | ||
376 : | if(ent>0){ | ||
377 : | DispatchKeyValue(ent,"classname","func_bomb_target") | ||
378 : | DispatchSpawn(ent) | ||
379 : | entity_set_size(ent,Float:{-4096.0,-4096.0,-4096.0},Float:{4096.0,4096.0,4096.0}) | ||
380 : | entity_set_origin(ent,Float:{0.0,0.0,0.0}) | ||
381 : | bombtargent=ent | ||
382 : | } | ||
383 : | } | ||
384 : | } | ||
385 : | return PLUGIN_HANDLED | ||
386 : | } | ||
387 : | public round_end(){ | ||
388 : | if(bombtargent){ | ||
389 : | remove_entity(bombtargent) | ||
390 : | bombtargent=0 | ||
391 : | } | ||
392 : | if(teamschanged){ | ||
393 : | new players[32],num | ||
394 : | get_players(players,num) | ||
395 : | for(new i=0;i<num;i++){ | ||
396 : | if(playersteam[players[i]]){ | ||
397 : | cs_set_user_team(players[i],playersteam[players[i]]) | ||
398 : | if(0<playersteam[players[i]]<3){ | ||
399 : | if(is_user_alive(players[i])){ | ||
400 : | set_msg_block(get_user_msgid("DeathMsg"),1) | ||
401 : | user_kill(players[i],1) | ||
402 : | } | ||
403 : | cs_set_user_deaths(players[i],cs_get_user_deaths(players[i])-1) | ||
404 : | } | ||
405 : | } | ||
406 : | } | ||
407 : | for(new i=0;i<32;i++)playersteam[i]=0 | ||
408 : | teamschanged=false | ||
409 : | } | ||
410 : | return PLUGIN_HANDLED | ||
411 : | } | ||
412 : | public wpnstrip(id,level,cid){ | ||
413 : | if(cmd_access(id,level,cid,2)){ | ||
414 : | new targets[32],targnum | ||
415 : | targets=targets_find(id,targnum,ALIVE+IMMUNITY+SELF,_,WCALT) | ||
416 : | if(targnum){ | ||
417 : | for(new i=0;i<targnum;i++)weaponstrip(targets[i],read_argc()<3?0:1) | ||
418 : | if(id!=0)targets_activity(id,targets,targnum) | ||
419 : | } | ||
420 : | } | ||
421 : | return PLUGIN_HANDLED | ||
422 : | } | ||
423 : | public kick_quit(id,level,cid){ | ||
424 : | if(cmd_access(id,level,cid,2)){ | ||
425 : | new targets[32],targnum | ||
426 : | targets=targets_find(id,targnum) | ||
427 : | if(targnum){ | ||
428 : | for(new i=0;i<targnum;i++)engclient_cmd(targets[i],"quit") | ||
429 : | } | ||
430 : | if(id!=0)targets_activity(id,targets,targnum) | ||
431 : | } | ||
432 : | return PLUGIN_HANDLED | ||
433 : | } | ||
434 : | public stopsounds(id,level,cid){ | ||
435 : | if(cmd_access(id,level,cid,2)){ | ||
436 : | new targets[32],targnum | ||
437 : | targets=targets_find(id,targnum) | ||
438 : | if(targnum){ | ||
439 : | for(new i=0;i<targnum;i++)engclient_cmd(targets[i],"stopsound") | ||
440 : | } | ||
441 : | if(id!=0)targets_activity(id,targets,targnum) | ||
442 : | } | ||
443 : | return PLUGIN_HANDLED | ||
444 : | } | ||
445 : | public handlesay(id,level,cid){ | ||
446 : | new arg[16] | ||
447 : | read_argv(1,arg,15) | ||
448 : | if(equali(arg,"glow",4)){ | ||
449 : | glow(id,level,cid,arg) | ||
450 : | return PLUGIN_HANDLED | ||
451 : | } | ||
452 : | return PLUGIN_CONTINUE | ||
453 : | } | ||
454 : | public glow(id,level,cid,arg[]){ | ||
455 : | if(cmd_access(id,level,cid,2)){ | ||
456 : | if(parse(arg,arg,0,arg,15)==2){ | ||
457 : | new Float:col[3],bool:set=true | ||
458 : | if(equali(arg,"off")){ | ||
459 : | client_print(id,print_chat,"[AMXX] You are no longer glowing.") | ||
460 : | entity_set_int(id,EV_INT_renderfx,kRenderFxNone) | ||
461 : | //set_user_rendering(id) | ||
462 : | set=false | ||
463 : | } | ||
464 : | else if(equali(arg,"red")){col[0]=255.0;col[1]=0.0;col[2]=0.0;} | ||
465 : | else if(equali(arg,"green")){col[0]=0.0;col[1]=255.0;col[2]=0.0;} | ||
466 : | else if(equali(arg,"blue")){col[0]=0.0;col[1]=0.0;col[2]=255.0;} | ||
467 : | else if(equali(arg,"orange")){col[0]=255.0;col[1]=165.0;col[2]=0.0;} | ||
468 : | else if(equali(arg,"yellow")){col[0]=255.0;col[1]=255.0;col[2]=0.0;} | ||
469 : | else if(equali(arg,"pink")){col[0]=255.0;col[1]=192.0;col[2]=203.0;} | ||
470 : | else if(equali(arg,"white")){col[0]=255.0;col[1]=255.0;col[2]=255.0;} | ||
471 : | else { | ||
472 : | client_print(id,print_chat,"[AMXX] Invalid glow value.") | ||
473 : | set=false | ||
474 : | } | ||
475 : | if(set){ | ||
476 : | entity_set_int(id,EV_INT_renderfx,kRenderFxGlowShell) | ||
477 : | entity_set_vector(id,EV_VEC_rendercolor,col) | ||
478 : | //set_user_rendering(id,kRenderFxGlowShell,floatround(col[0]),floatround(col[1]),floatround(col[2]),_,255) | ||
479 : | client_print(id,print_chat,"[AMXX] You are now glowing %s.",arg) | ||
480 : | } | ||
481 : | } | ||
482 : | else client_print(id,print_chat,"[AMXX] Invalid number of arguments.") | ||
483 : | } | ||
484 : | else client_print(id,print_chat,"[AMXX] You have no access to the glow command.") | ||
485 : | return PLUGIN_HANDLED | ||
486 : | } | ||
487 : | public plugin_init(){ | ||
488 : | register_plugin("All In One","0.8.2","Don Juan-jello") | ||
489 : | //CVARS | ||
490 : | register_cvar("amx_slashme","1") | ||
491 : | //Useful Commands | ||
492 : | register_concmd("amx_clexec","clexec",ADMIN_RCON,"<!>[name|^^|.|*name|#uid|@CT|@T] [command]") | ||
493 : | |||
494 : | register_concmd("amx_teamswap","teamswap",ADMIN_RCON,"<!>[name|^^|.|*name|#uid|@CT|@T]") | ||
495 : | register_concmd("amx_t","forcet",ADMIN_RCON,"<!>[name|^^|.|*name|#uid|@CT|@T]") | ||
496 : | register_concmd("amx_ct","forcect",ADMIN_RCON,"<!>[name|^^|.|*name|#uid|@CT|@T]") | ||
497 : | register_concmd("amx_spec","forcespec",ADMIN_RCON,"<!>[name|^^|.|*name|#uid|@CT|@T]") | ||
498 : | |||
499 : | register_concmd("amx_slay2","slay",ADMIN_SLAY,"<!>[name|^^|.|*name|#uid|@CT|@T]") | ||
500 : | register_concmd("amx_slap2","slap",ADMIN_SLAY,"<!>[name|^^|.|*name|#uid|@CT|@T]") | ||
501 : | register_concmd("amx_wpnstrip","wpnstrip",ADMIN_SLAY,"<!>[name|^^|.|*name|#uid|@CT|@T]") | ||
502 : | |||
503 : | register_concmd("amx_quit","kick_quit",ADMIN_KICK,"<!>[name|^^|.|*name|#uid|@CT|@T]") | ||
504 : | register_concmd("amx_stopallsounds","stopsounds",ADMIN_KICK,"- Execute stopsound on all clients.") | ||
505 : | //Fun Commands | ||
506 : | register_concmd("amx_noclip","aio_noclip",ADMIN_VOTE,"<!>[name|^^|.|*name|#uid|@CT|@T] [1|0]") | ||
507 : | register_concmd("amx_fly","aio_fly",ADMIN_VOTE,"<!>[name|^^|.|*name|#uid|@CT|@T] [1|0]") | ||
508 : | register_concmd("amx_godmode","aio_godmode",ADMIN_VOTE,"<!>[name|^^|.|*name|#uid|@CT|@T] [1|0]") | ||
509 : | register_concmd("amx_gravity","gravity",ADMIN_VOTE,"<!>[name|^^|.|*name|#uid|@CT|@T] [% norm grav]") | ||
510 : | //register_concmd("amx_spawn","pspawn",ADMIN_VOTE,"<!>[name|^^|.|*name|#uid|@CT|@T]") | ||
511 : | register_concmd("amx_speed","speed",ADMIN_VOTE,"<!>[name|^^|.|*name|#uid|@CT|@T] [speed]") | ||
512 : | |||
513 : | register_concmd("amx_give","give",ADMIN_VOTE,"<!>[name|^^|.|*name|#uid|@CT|@T] <item>") | ||
514 : | register_concmd("amx_give_wpnlist","wpnlist",0,"- Shows list of weapons for use with give.") | ||
515 : | register_concmd("amx_give_itemlist","itemlist",0,"- Shows list of items for use with give.") | ||
516 : | |||
517 : | register_concmd("say","handlesay") | ||
518 : | |||
519 : | //register_concmd("amx_headshot","headshot",ADMIN_SLAY,"<!>[name|^^|.|*name|#uid|@CT|@T] <wpn name>") | ||
520 : | register_concmd("amx_plant","plantanywhere",ADMIN_SLAY,"- Allow bomb plant anywhere.") | ||
521 : | //Say commands | ||
522 : | register_clcmd("say /motd","motd",0,"- Veiw server MOTD.") | ||
523 : | register_clcmd("say","slashme",0) | ||
524 : | //Events | ||
525 : | //register_logevent("round_start",2,"1=Round_Start") | ||
526 : | register_logevent("round_end",2,"1=Round_End") | ||
527 : | return PLUGIN_CONTINUE | ||
528 : | } |
Contact | ViewVC Help |
Powered by ViewVC 1.0.4 |