Raised This Month: $ Target: $400
 0% 

Round Start Error


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
The Specialist
BANNED
Join Date: Nov 2006
Old 12-20-2006 , 22:52   Round Start Error
Reply With Quote #1

Ok Im trying t fix this plugin to get approved. I changed alot of it . But on round start , everyone dies including me then it does the lightning. Can you tell me whas wrong here ?
Thanks

Code:
#include <amxmodx> #include <fakemeta> new g_Switch; new g_TSamari; new g_CTSamari; new sprite; new origin[3]; new Lightning; new VictomOrigin[3]; new AttackerOrigin[3]; new Weapon; new frags; public plugin_init() {  register_plugin("The Samari","0.3","The Specialist");  g_Switch = register_cvar("smr_switch","1");    register_event("HLTV", "RoundStart", "a", "1=0", "2=0");  register_event("CurWeapon","SamariModel","be","1=1");  register_event("Damage" , "SamariDamage" , "be");    register_forward(FM_PlayerPreThink,"MakeSamariSmoke");  Lightning = engfunc(EngFunc_PrecacheModel,"sprites/lgtning.spr");  sprite = engfunc(EngFunc_PrecacheModel,"sprites/steam1.spr");  engfunc(EngFunc_PrecacheModel,"models/v_samari.mdl");  engfunc(EngFunc_PrecacheModel,"models/player/ninja.mdl"); } public RoundStart() {  if(get_pcvar_num(g_Switch))  g_CTSamari = 0;  g_TSamari = 0;    new Terrorist[32],T_num;  get_players(Terrorist,T_num,"ace","TERRORIST");  g_TSamari = Terrorist[random_num(0,T_num-1)];    new CTs[32],CT_num;  get_players(CTs,CT_num,"ace","CT");  g_CTSamari = CTs[random_num(0,CT_num-1)]; } public MakeSamariSmoke(id) {  if((g_CTSamari == id || g_TSamari == id) && ( pev(id,pev_button) &  IN_USE  ))  pev(id,pev_origin,origin);  message_begin(MSG_BROADCAST ,SVC_TEMPENTITY);  write_byte(5);  engfunc(EngFunc_WriteCoord,origin[0]);  engfunc(EngFunc_WriteCoord,origin[1]);  engfunc(EngFunc_WriteCoord,origin[2]);  write_short(sprite);  write_byte(255);  write_byte(0);  message_end();  return FMRES_IGNORED; } public SamariModel(id) {  Weapon = read_data(2)    if((g_CTSamari == id || g_TSamari  == id) && ( Weapon == CSW_KNIFE))  set_pev( id, pev_viewmodel2,"models/v_samari.mdl");  set_pev(id,pev_model,"models/ninja.mdl");  set_pev(id,pev_maxspeed,330.0);  return ; } public SamariDamage(id) {  new Samari_Damage = read_data( 2 ) + 55;  new AttackerID = get_user_attacker( id, Weapon );  new Float:fAHealth;  new Float:fVHealth ;    if((Weapon == CSW_KNIFE) && (AttackerID == g_CTSamari || AttackerID == g_TSamari ) && (is_user_connected(AttackerID)))  pev(AttackerID,pev_health, fAHealth);  pev(id,pev_health, fVHealth);  set_pev(AttackerID,pev_health, fAHealth + fVHealth );  pev(id,pev_origin,VictomOrigin);  pev(AttackerID,pev_origin,AttackerOrigin);    message_begin( MSG_BROADCAST, SVC_TEMPENTITY)  write_byte(8);  write_short(AttackerID);  write_short(id);  write_short(Lightning);  write_byte(0)  write_byte(0);  write_byte(25);  write_byte(30);  write_byte(10);    write_byte(255);  write_byte(255);  write_byte(255)  write_byte(255);  write_byte(0);  message_end();    if ((is_user_alive(id)) && (fVHealth < Samari_Damage))  pev(AttackerID, pev_frags, frags);  set_pev(AttackerID, pev_frags, ++frags);  dllfunc(DLLFunc_ClientKill, id);  return 1; }
The Specialist is offline
Send a message via AIM to The Specialist
 



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 22:30.


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