Raised This Month: $ Target: $400
 0% 

Server Crashing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
The Specialist
BANNED
Join Date: Nov 2006
Old 11-22-2006 , 07:59   Server Crashing
Reply With Quote #1

Im trying to get this plugin working right , but every time i switch to AWP my server crashes. The wierd part is there are no run time errors showing up . Any idea what would make this crash ?
Code:
#include <amxmodx> #include <cstrike> #include <engine> // Gloabal Variables new g_Rail_Gun; new beam; public plugin_init() {     register_plugin("Rail Gun","0.1","The Specialist");     g_Rail_Gun = register_cvar("rg_switch","1");     register_cvar("rg_rail_damage","1");     register_clcmd("amx_rail_arena","amx_rail_arena",ADMIN_CVAR,"Starts A Rail Gun Arena");     register_event("CurWeapon","weapon_event","be","1=1");     register_event("Damage","rail_damage","b"); } public plugin_precache() {     // precache the files needed for models and sounds         precache_model("models/v_gauss.mdl");     precache_model("models/p_gauss.mdl");     beam = precache_model("sprites/smoke.spr"); } // current weapon event public weapon_event(id) {     // if cvar is off then end fucntion         if(get_pcvar_num(g_Rail_Gun)==0)     {         return PLUGIN_HANDLED;     }else{         // get weapon and ammo id's                 new Weapon_ID = read_data(2);             // if weapon is awp and plugin is on and mode is 1 then set models             if( Weapon_ID == CSW_AWP)         {             // sets the players awp to the rail gun model                 entity_set_string(id,EV_SZ_weaponmodel,"models/p_gauss.mdl");                     // sets the players view model to the rail guns model                     entity_set_string(id,EV_SZ_viewmodel,"models/v_gauss.mdl");                         // add effects to bullets                         rail_fire();             return PLUGIN_HANDLED;         }     }     return PLUGIN_HANDLED; } // damage event public rail_damage(id) {     // get user attackers , waepons and damage     new g_AWeapon;     new g_Damage = read_data(2);         get_user_attacker(id,g_AWeapon);            // if user was shot by AWP multiply damage by cvar         if(g_AWeapon == CSW_AWP )     {         // hit user with fake damage                 fakedamage(id,"weapon_awp",float(g_Damage),DMG_BULLET  &&  DMG_BLAST && DMG_ENERGYBEAM)         return PLUGIN_HANDLED;     }     return PLUGIN_HANDLED; } // sounds and messages for bullets public rail_fire() {     // effects that follwo the bulelts     message_begin(MSG_BROADCAST, SVC_TEMPENTITY);     write_byte(22);     write_short(beam);     write_byte(45);     write_byte(4);     write_byte(100);     write_byte(100);     write_byte(250);     write_byte(100); }             public amx_rail_arena(id) {     return PLUGIN_HANDLED; }
thanks
The Specialist is offline
Send a message via AIM to The Specialist
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-22-2006 , 09:10   Re: Server Crashing
Reply With Quote #2

#define TE_BEAMFOLLOW 22 // Create a line of decaying beam segments until entity stops moving
// write_byte(TE_BEAMFOLLOW)
// write_short(entity:attachment to follow)
// write_short(sprite index)
// write_byte(life in 0.1's)
// write_byte(line width in 0.1's)
// write_byte(red)
// write_byte(green)
// write_byte(blue)
// write_byte(brightness)
[ --<-@ ] Black Rose is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 11-22-2006 , 09:50   Re: Server Crashing
Reply With Quote #3

you forgot "message_end()"
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 11-22-2006 , 10:20   Re: Server Crashing
Reply With Quote #4

Code:
#include <amxmodx> #include <cstrike> #include <engine> // Gloabal Variables new g_Rail_Gun; new beam; public plugin_init() {         register_plugin("Rail Gun","0.1","The Specialist");         g_Rail_Gun = register_cvar("rg_switch","1");         register_cvar("rg_rail_damage","1");         register_clcmd("amx_rail_arena","amx_rail_arena",ADMIN_CVAR,"Starts A Rail Gun Arena");         register_event("CurWeapon","weapon_event","b","1=1");         register_event("Damage","rail_damage","b"); } public plugin_precache() {         precache_model("models/v_gauss.mdl");         precache_model("models/p_gauss.mdl");         beam = precache_model("sprites/smoke.spr"); } public weapon_event(id) {         if(!get_pcvar_num(g_Rail_Gun))                 return         else         {                 if(read_data(2) == CSW_AWP)                 {                         entity_set_string(id,EV_SZ_weaponmodel,"models/p_gauss.mdl");                         entity_set_string(id,EV_SZ_viewmodel,"models/v_gauss.mdl");                         rail_fire(id);                         return                 }         }         return } public rail_damage(id) {         new g_AWeapon;                 get_user_attacker(id,g_AWeapon);                 if(g_AWeapon == CSW_AWP )         {                 fakedamage(id,"weapon_awp",float(read_data(2)),DMG_BULLET  &&  DMG_BLAST && DMG_ENERGYBEAM)                 return PLUGIN_HANDLED;         }         return PLUGIN_HANDLED; } public rail_fire(id) {         message_begin(MSG_BROADCAST, SVC_TEMPENTITY);         write_byte(22);         write_short(id);         write_short(beam)         write_byte(45);         write_byte(4);         write_byte(100);         write_byte(100);         write_byte(250);         write_byte(100);         message_end() } public amx_rail_arena(id) {         return PLUGIN_HANDLED; }
sorry for removing the comment from you code.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-22-2006 , 10:21   Re: Server Crashing
Reply With Quote #5

for the entity: atachment to follow , how would i make it follow awp bullets ?
The Specialist is offline
Send a message via AIM to The Specialist
jim_yang
Veteran Member
Join Date: Aug 2006
Old 11-22-2006 , 10:35   Re: Server Crashing
Reply With Quote #6

i guess bullets are not entities in cs, never worked on them.
you'd better try another tempentity message using
get_user_origin(id,origin,4)
4 - Position from last bullet hit (only CS)4 - Position from last bullet hit (only CS)
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 11-22-2006 , 10:38   Re: Server Crashing
Reply With Quote #7

See the Bullet Time source;
http://forums.alliedmods.net/showthread.php?t=11670
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 11-22-2006 , 10:46   Re: Server Crashing
Reply With Quote #8

oh, my guess was wrong. thanks for the information above.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-22-2006 , 15:50   Re: Server Crashing
Reply With Quote #9

No, jim_yang is right, there are no bullet entities: damage calculations are done instantly upon firing a round. I believe what bullet time does is create its own fake bullet entity to replicate a slow-mo effect.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 11-22-2006 , 16:26   Re: Server Crashing
Reply With Quote #10

I think that quake1 had a cvar called 'cg_debugbullet', wich leaves a trail, you should see into that.
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
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 06:49.


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