Raised This Month: $ Target: $400
 0% 

Advanced Tracers help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Silent Sniper
Member
Join Date: May 2006
Location: UK
Old 05-13-2006 , 10:42   Advanced Tracers help
Reply With Quote #1

Code:
// Ivan's Advanced Tracer Plugin 0.25 by Ivan <[email protected]> // Basing on the original Tracer Script by OLO /* Changelog from 0.1 to 0.25 * Added check for CS, now when firing tracers will go to the hitpoint, not the aimpoint * Added Adminclientcommands for setting Tracers, amx_settracers & amx_setamplitude * Renamed CVAR amx_ln to amx_tracers_ln * Lightning Tracers won't start in the middle of your screen anymore (now they come from the lower end - isn't that nasty to look at) * Now the last shot in mag makes tracers too. * Some Speed/CPU usage tweaks. * Better compatibilty with other Mods. */ // VERY VERY CPU optimized version. #include <amxmodx> #define SHOTGUN_AIMING 32 #define SHOTGUN_X2 64 new light; new tracers, ln, is_cs = 0; lightning(vec1[3],vec2[3]) {     //Lightning     message_begin( MSG_BROADCAST,SVC_TEMPENTITY);     write_byte( 0 );     write_coord(vec1[0]);     write_coord(vec1[1]);     write_coord(vec1[2]);     write_coord(vec2[0]);     write_coord(vec2[1]);     write_coord(vec2[2]);     write_short( light );     write_byte( 1 ); // framestart     write_byte( 5 ); // framerate     write_byte( 2 ); // life     write_byte( 20 ); // width     //write_byte( 30 ); // noise     write_byte(ln);     write_byte( 200 ); // r, g, b     write_byte( 200 ); // r, g, b     write_byte( 200 ); // r, g, b     write_byte( 200 ); // brightness     write_byte( 200 ); // speed     message_end(); } tracer(vec1[3],vec2[3]) {     message_begin(MSG_PAS, SVC_TEMPENTITY,vec1 );     write_byte( 6 ) /* TE_TRACER - see commo/const.h in HLSDK */     write_coord(vec1[0]);     write_coord(vec1[1]);     write_coord(vec1[2]);     write_coord(vec2[0]);     write_coord(vec2[1]);     write_coord(vec2[2]);     message_end(); } draw(vec1[3],vec2[3]) {     if(tracers==1) {         tracer(vec1,vec2);     } else {         lightning(vec1,vec2);     } } new users_ammo[33]; new users_w[33] public drawtracer(id) {     if(tracers==0) {         return PLUGIN_HANDLED;     }     new ammo = read_data(3), weapon = read_data(2); // I read it only once to save CPU time.     if(users_ammo[id]>ammo && ammo>=0 && users_w[id]==weapon) {         new vec1[3], vec2[3];         if(tracers == 2) {             get_user_origin(id,vec1);             vec1[2]+=8;             // For lightnings we do it a special way, 'cause lightnings from eye positon look shit         } else {             get_user_origin(id,vec1,1);         }         if(is_cs==1) {             get_user_origin(id,vec2,4);         } else {             get_user_origin(id,vec2,3);         }         if(is_cs == 1 && (weapon==CSW_M3 || weapon==CSW_XM1014)) { // Shotguns in CS             draw(vec1,vec2);             vec2[0]+=SHOTGUN_AIMING;             draw(vec1,vec2);             vec2[1]+=SHOTGUN_AIMING;             draw(vec1,vec2);             vec2[2]+=SHOTGUN_AIMING;             draw(vec1,vec2); 108.       vec2[0]-=SHOTGUN_X2;             //vec2[0]-=SHOTGUN_AIMING; // Repeated substraction is faster then multiplication !             //vec2[0]-=SHOTGUN_AIMING; // Repeated substraction is faster then multiplication ! 111.            draw(vec1,vec2); 112.       vec2[0]-=SHOTGUN_X2;             //vec2[1]-=SHOTGUN_AIMING; // Repeated substraction is faster then multiplication !             //vec2[1]-=SHOTGUN_AIMING; // Repeated substraction is faster then multiplication ! 115.            draw(vec1,vec2); 116.            vec2[0]-=SHOTGUN_X2;        //vec2[2]-=SHOTGUN_AIMING; // Repeated substraction is faster then multiplication !             //vec2[2]-=SHOTGUN_AIMING; // Repeated substraction is faster then multiplication ! 119.            draw(vec1,vec2);         } else {             draw(vec1,vec2);         }         users_ammo[id]=ammo;     } else {         users_w[id]=weapon;         users_ammo[id]=ammo;     }     return PLUGIN_HANDLED; } public checktracervars() {     tracers = get_cvar_num("amx_tracers");     ln = get_cvar_num("amx_tracers_ln"); } public amx_settracers(id) {     new arg1[32];     new nt;     read_argv(1,arg1,32);     nt = str_to_num(arg1);     if(nt == 1) {         client_print(id,print_console,"[AMX] Advanced Tracers> Tracer mode set to 1, Normal Tracers.");     } else if(nt == 2) {         client_print(id,print_console,"[AMX] Advanced Tracers> Tracer mode set to 2, Lightning Tracers.");     } else if(nt==0 && equal(arg1,"0")) {         client_print(id,print_console,"[AMX] Advanced Tracers> Tracer mode set to 0, No Tracers.");     } else {         client_print(id,print_console,"[AMX] Advanced Tracers> Please type 0, 1 or 2!");         return PLUGIN_HANDLED;     }     tracers = nt;     set_cvar_num("amx_tracers",tracers);     return PLUGIN_HANDLED; } public amx_setamplitude(id) {     new arg1[32];     new na;     read_argv(1,arg1,32);     na = str_to_num(arg1);     if(na>=0) {         client_print(id,print_console,"[AMX] Advanced Tracers> Amplitude for Lightning Tracers set to %d.",na);         ln = na;         set_cvar_num("amx_tracers_ln",ln);     }     return PLUGIN_HANDLED; } public plugin_precache() {     light = precache_model("sprites/lgtning.spr");     return PLUGIN_CONTINUE; } public plugin_init() {     new modname[32];     register_plugin("Advanced Tracers","0.1","[email protected]");     register_event("CurWeapon","drawtracer","be","1=1"); //,"3>=0");     register_cvar("amx_tracers","1")     register_cvar("amx_tracers_ln","30");     register_concmd("amx_settracers","amx_settracers",ADMIN_LEVEL_A,"<0|1|2> Set tracer mode.");     register_concmd("amx_setamplitude","amx_setamplitude",ADMIN_LEVEL_A,"<noise> Noise for lightning tracers.");     set_task(5.0,"checktracervars",0,"",0,"b");     checktracervars();     get_modname(modname,32);     if(equal(modname,"cstrike")) is_cs = 1;     return PLUGIN_CONTINUE; }

im getting an error ...

Welcome to the AMX Mod X 1.70-300 Compiler.
Copyright (c) 1997-2005 ITB CompuPhase, AMX Mod X Team

Warning: Loose indentation on line 108
Warning: Loose indentation on line 111
Warning: Loose indentation on line 112
Warning: Loose indentation on line 115
Header size: 620 bytes
Code size: 4768 bytes
Data size: 2796 bytes
Stack/heap size: 16384 bytes; estimated max. usage=47 cells (188 bytes)
Total requirements: 24568 bytes

4 Warnings.
Copied output file to: C:\Program Files\Valve\Steam\\SteamApps\**********\count er-strike\cstrike\addons\amxmodx\plugins\
Done.

What Does This Mean And Could Some One Fix It And Point Out How/Where They Changed Please
__________________
Silent Sniper
Silent Sniper is offline
Send a message via AIM to Silent Sniper
Willmaker
Senior Member
Join Date: Dec 2004
Location: Sydney, Australia
Old 05-13-2006 , 17:43   Re: Advanced Tracers help
Reply With Quote #2

Quote:
Originally Posted by Silent Sniper

Warning: Loose indentation on line 108
Warning: Loose indentation on line 111
Warning: Loose indentation on line 112
Warning: Loose indentation on line 115
That just means the spacing is wrong, like too many tabs used on a line, or a space instead of a tab. This is nothing to worry about, the plugin will still compile and it should still work.

If it makes you feel any better:

Code:
// Ivan's Advanced Tracer Plugin 0.25 by Ivan <[email protected]> // Basing on the original Tracer Script by OLO /* Changelog from 0.1 to 0.25 * Added check for CS, now when firing tracers will go to the hitpoint, not the aimpoint * Added Adminclientcommands for setting Tracers, amx_settracers & amx_setamplitude * Renamed CVAR amx_ln to amx_tracers_ln * Lightning Tracers won't start in the middle of your screen anymore (now they come from the lower end - isn't that nasty to look at) * Now the last shot in mag makes tracers too. * Some Speed/CPU usage tweaks. * Better compatibilty with other Mods. */ // VERY VERY CPU optimized version. #include <amxmodx> #define SHOTGUN_AIMING 32 #define SHOTGUN_X2 64 new light; new tracers, ln, is_cs = 0; lightning(vec1[3],vec2[3]) {     //Lightning     message_begin( MSG_BROADCAST,SVC_TEMPENTITY);     write_byte( 0 );     write_coord(vec1[0]);     write_coord(vec1[1]);     write_coord(vec1[2]);     write_coord(vec2[0]);     write_coord(vec2[1]);     write_coord(vec2[2]);     write_short( light );     write_byte( 1 ); // framestart     write_byte( 5 ); // framerate     write_byte( 2 ); // life     write_byte( 20 ); // width     //write_byte( 30 ); // noise     write_byte(ln);     write_byte( 200 ); // r, g, b     write_byte( 200 ); // r, g, b     write_byte( 200 ); // r, g, b     write_byte( 200 ); // brightness     write_byte( 200 ); // speed     message_end(); } tracer(vec1[3],vec2[3]) {     message_begin(MSG_PAS, SVC_TEMPENTITY,vec1 );     write_byte( 6 ) /* TE_TRACER - see commo/const.h in HLSDK */     write_coord(vec1[0]);     write_coord(vec1[1]);     write_coord(vec1[2]);     write_coord(vec2[0]);     write_coord(vec2[1]);     write_coord(vec2[2]);     message_end(); } draw(vec1[3],vec2[3]) {     if(tracers==1) {         tracer(vec1,vec2);     } else {         lightning(vec1,vec2);     } } new users_ammo[33]; new users_w[33] public drawtracer(id) {     if(tracers==0) {         return PLUGIN_HANDLED;     }     new ammo = read_data(3), weapon = read_data(2); // I read it only once to save CPU time.     if(users_ammo[id]>ammo && ammo>=0 && users_w[id]==weapon) {         new vec1[3], vec2[3];         if(tracers == 2) {             get_user_origin(id,vec1);             vec1[2]+=8;             // For lightnings we do it a special way, 'cause lightnings from eye positon look shit         } else {             get_user_origin(id,vec1,1);         }         if(is_cs==1) {             get_user_origin(id,vec2,4);         } else {             get_user_origin(id,vec2,3);         }         if(is_cs == 1 && (weapon==CSW_M3 || weapon==CSW_XM1014)) { // Shotguns in CS             draw(vec1,vec2);             vec2[0]+=SHOTGUN_AIMING;             draw(vec1,vec2);             vec2[1]+=SHOTGUN_AIMING;             draw(vec1,vec2);             vec2[2]+=SHOTGUN_AIMING;             draw(vec1,vec2);             vec2[0]-=SHOTGUN_X2;             //vec2[0]-=SHOTGUN_AIMING; // Repeated substraction is faster then multiplication !             //vec2[0]-=SHOTGUN_AIMING; // Repeated substraction is faster then multiplication !             draw(vec1,vec2);             vec2[0]-=SHOTGUN_X2;             //vec2[1]-=SHOTGUN_AIMING; // Repeated substraction is faster then multiplication !             //vec2[1]-=SHOTGUN_AIMING; // Repeated substraction is faster then multiplication !             draw(vec1,vec2);             vec2[0]-=SHOTGUN_X2;        //vec2[2]-=SHOTGUN_AIMING; // Repeated substraction is faster then multiplication !             //vec2[2]-=SHOTGUN_AIMING; // Repeated substraction is faster then multiplication !             draw(vec1,vec2);         } else {             draw(vec1,vec2);         }         users_ammo[id]=ammo;     } else {         users_w[id]=weapon;         users_ammo[id]=ammo;     }     return PLUGIN_HANDLED; } public checktracervars() {     tracers = get_cvar_num("amx_tracers");     ln = get_cvar_num("amx_tracers_ln"); } public amx_settracers(id) {     new arg1[32];     new nt;     read_argv(1,arg1,32);     nt = str_to_num(arg1);     if(nt == 1) {         client_print(id,print_console,"[AMX] Advanced Tracers> Tracer mode set to 1, Normal Tracers.");     } else if(nt == 2) {         client_print(id,print_console,"[AMX] Advanced Tracers> Tracer mode set to 2, Lightning Tracers.");     } else if(nt==0 && equal(arg1,"0")) {         client_print(id,print_console,"[AMX] Advanced Tracers> Tracer mode set to 0, No Tracers.");     } else {         client_print(id,print_console,"[AMX] Advanced Tracers> Please type 0, 1 or 2!");         return PLUGIN_HANDLED;     }     tracers = nt;     set_cvar_num("amx_tracers",tracers);     return PLUGIN_HANDLED; } public amx_setamplitude(id) {     new arg1[32];     new na;     read_argv(1,arg1,32);     na = str_to_num(arg1);     if(na>=0) {         client_print(id,print_console,"[AMX] Advanced Tracers> Amplitude for Lightning Tracers set to %d.",na);         ln = na;         set_cvar_num("amx_tracers_ln",ln);     }     return PLUGIN_HANDLED; } public plugin_precache() {     light = precache_model("sprites/lgtning.spr");     return PLUGIN_CONTINUE; } public plugin_init() {     new modname[32];     register_plugin("Advanced Tracers","0.1","[email protected]");     register_event("CurWeapon","drawtracer","be","1=1"); //,"3>=0");     register_cvar("amx_tracers","1")     register_cvar("amx_tracers_ln","30");     register_concmd("amx_settracers","amx_settracers",ADMIN_LEVEL_A,"<0|1|2> Set tracer mode.");     register_concmd("amx_setamplitude","amx_setamplitude",ADMIN_LEVEL_A,"<noise> Noise for lightning tracers.");     set_task(5.0,"checktracervars",0,"",0,"b");     checktracervars();     get_modname(modname,32);     if(equal(modname,"cstrike")) is_cs = 1;     return PLUGIN_CONTINUE; }
__________________
GargStudios.net - Australian SvenCoop/Ent Server with Time Based Rewards
Willmaker is offline
Send a message via ICQ to Willmaker Send a message via AIM to Willmaker Send a message via MSN to Willmaker Send a message via Yahoo to Willmaker
Silent Sniper
Member
Join Date: May 2006
Location: UK
Old 05-13-2006 , 18:05  
Reply With Quote #3

Thnx alot bud
__________________
Silent Sniper
Silent Sniper is offline
Send a message via AIM to Silent Sniper
Reply



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 16:28.


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