Raised This Month: $ Target: $400
 0% 

Slaylosers help!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 11-08-2009 , 14:31   Re: Slaylosers help!
Reply With Quote #1

Quote:
Originally Posted by IcaCat View Post
Hello

Im new in scripting on the pawn language and i need help about plugin called slaylosers.
In
PHP Code:
#include <amxmodx> 
#include <amxmisc>
 
new white
new lightning
new g_sModelIndexSmoke
 
public plugin_init(){ 
 
    
register_plugin("AMX Slay Losers","1.0","[email protected]"
    
register_event("SendAudio","end_round","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw"
 
    
register_cvar("mp_slaylosers","1",FCVAR_SERVER)
 
    return 
PLUGIN_CONTINUE 

 
public 
end_round(){
 
    
// Only active if CVAR is not equal to 0
    
if( get_cvar_num("mp_slaylosers") ){
        new 
parm[32
        new 
len read_data(2,parm,31
        
set_task(1.0,"slay_those_losers",0,parmlen 1)
    }
 
    return 
PLUGIN_CONTINUE
}
// Slays each player who failed to stop the other team from completing the objective.
// A random slay method is chosen for each player.
public slay_those_losers(parm[]) { 
 new 
origin[3], srco[3]
 new 
player[32], playersnum 
 
new id
 
 get_players
(player,playersnum,"ea",(parm[7] == 't') ? "CT" "TERRORIST" 
 
 for(new 
0playersnum; ++i){ 
  
id player[i
  
get_user_origin(id,origin)   
  
origin[2] -= 26
  srco
[0]=origin[0]+150
  srco
[1]=origin[1]+150
  srco
[2]=origin[2]+800
  
switch(random_num(1,3)){ 
   case 
1:{
    
slay_lightning(srco,origin)
    
emit_sound(id,CHAN_ITEM"ambience/thunder_clap.wav"1.0ATTN_NORM0PITCH_NORM)
   }
   case 
2:{
    
slay_blood(origin)
    
emit_sound(id,CHAN_ITEM"weapons/headshot2.wav"1.0ATTN_NORM0PITCH_NORM)
   }
   case 
3: {
    
slay_explode(origin)
    
emit_sound(id,CHAN_ITEM"weapons/explode3.wav"1.0ATTN_NORM0PITCH_NORM)
   }
  }
                  
set_hudmessage(1781441, -1.0, -0.410.51.70.20.2,5);
  
show_hudmessage(id"Objective Failed^nFailure Is Not An Option^nYou Die Now" );
  
user_kill(id,1
 } 

 
slay_explode(vec1[3]) { 
 
// blast circles 
 
message_beginMSG_BROADCAST,SVC_TEMPENTITY,vec1
 
write_byte21 
 
write_coord(vec1[0]) 
 
write_coord(vec1[1]) 
 
write_coord(vec1[2] + 16
 
write_coord(vec1[0]) 
 
write_coord(vec1[1]) 
 
write_coord(vec1[2] + 1936
 
write_shortwhite 
 
write_byte// startframe 
 
write_byte// framerate 
 
write_byte// life 
 
write_byte16 // width 
 
write_byte// noise 
 
write_byte188 // r 
 
write_byte220 // g 
 
write_byte255 // b 
 
write_byte255 //brightness 
 
write_byte// speed 
 
message_end()
 
//Explosion2 
 
message_beginMSG_BROADCAST,SVC_TEMPENTITY
 
write_byte12 
 
write_coord(vec1[0]) 
 
write_coord(vec1[1]) 
 
write_coord(vec1[2]) 
 
write_byte188 // byte (scale in 0.1's) 
 
write_byte10 // byte (framerate) 
 
message_end()
 
//Smoke 
 
message_beginMSG_BROADCAST,SVC_TEMPENTITY,vec1
 
write_byte
 
write_coord(vec1[0]) 
 
write_coord(vec1[1]) 
 
write_coord(vec1[2]) 
 
write_shortg_sModelIndexSmoke 
 
write_byte)  
 
write_byte10 )  
 
message_end()

slay_blood(vec1[3]) { 
 
//LAVASPLASH 
 
message_beginMSG_BROADCAST,SVC_TEMPENTITY
 
write_byte10 
 
write_coord(vec1[0]) 
 
write_coord(vec1[1]) 
 
write_coord(vec1[2]) 
 
message_end() 

slay_lightning(vec1[3],vec2[3]) { 
 
//Lightning 
 
message_beginMSG_BROADCAST,SVC_TEMPENTITY
 
write_byte
 
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_shortlightning 
 
write_byte// framestart 
 
write_byte// framerate 
 
write_byte// life 
 
write_byte20 // width 
 
write_byte30 // noise 
 
write_byte200 // r, g, b 
 
write_byte200 // r, g, b 
 
write_byte200 // r, g, b 
 
write_byte200 // brightness 
 
write_byte200 // speed 
 
message_end()
 
//Sparks 
 
message_beginMSG_PVSSVC_TEMPENTITY,vec2
 
write_byte
 
write_coordvec2[0] ) 
 
write_coordvec2[1] ) 
 
write_coordvec2[2] ) 
 
message_end()
 
//Smoke     
 
message_beginMSG_BROADCAST,SVC_TEMPENTITY,vec2
 
write_byte
 
write_coord(vec2[0]) 
 
write_coord(vec2[1]) 
 
write_coord(vec2[2]) 
 
write_shortg_sModelIndexSmoke 
 
write_byte10 )  
 
write_byte10 )  
 
message_end()
}
 
public 
plugin_precache() {
 
 
g_sModelIndexSmoke precache_model("sprites/steam1.spr")
 
lightning precache_model("sprites/lgtning.spr")
 
white precache_model("sprites/white.spr")
 
precache_sound"ambience/thunder_clap.wav")
 
precache_sound"weapons/headshot2.wav")
 
precache_sound"weapons/explode3.wav")
 
 return 
PLUGIN_CONTINUE

I have added
PHP Code:
client_print(idprint_chat"my message"
so it looked like that
PHP Code:
#include <amxmodx> 
#include <amxmisc>
 
new white
new lightning
new g_sModelIndexSmoke
 
public plugin_init(){ 
 
    
register_plugin("AMX Slay Losers","1.0","[email protected]"
    
register_event("SendAudio","end_round","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw"
 
    
register_cvar("mp_slaylosers","1",FCVAR_SERVER)
 
    return 
PLUGIN_CONTINUE 

 
public 
end_round(){
 
    
// Only active if CVAR is not equal to 0
    
if( get_cvar_num("mp_slaylosers") ){
        new 
parm[32
        new 
len read_data(2,parm,31
        
set_task(1.0,"slay_those_losers",0,parmlen 1)
    }
 
    return 
PLUGIN_CONTINUE
}
// Slays each player who failed to stop the other team from completing the objective.
// A random slay method is chosen for each player.
public slay_those_losers(parm[]) { 
 new 
origin[3], srco[3]
 new 
player[32], playersnum 
 
new id
 
 get_players
(player,playersnum,"ea",(parm[7] == 't') ? "CT" "TERRORIST" 
 
 for(new 
0playersnum; ++i){ 
  
id player[i
  
get_user_origin(id,origin)   
  
origin[2] -= 26
  srco
[0]=origin[0]+150
  srco
[1]=origin[1]+150
  srco
[2]=origin[2]+800
  
switch(random_num(1,3)){ 
   case 
1:{
    
slay_lightning(srco,origin)
    
emit_sound(id,CHAN_ITEM"ambience/thunder_clap.wav"1.0ATTN_NORM0PITCH_NORM)
   }
   case 
2:{
    
slay_blood(origin)
    
emit_sound(id,CHAN_ITEM"weapons/headshot2.wav"1.0ATTN_NORM0PITCH_NORM)
   }
   case 
3: {
    
slay_explode(origin)
    
emit_sound(id,CHAN_ITEM"weapons/explode3.wav"1.0ATTN_NORM0PITCH_NORM)
   }
  }
  
client_print(idprint_chat"my message.")
                
set_hudmessage(1781441, -1.0, -0.410.51.70.20.2,5);
  
show_hudmessage(id"Objective Failed^nFailure Is Not An Option^nYou Die Now" );
  
user_kill(id,1
 } 

 
slay_explode(vec1[3]) { 
 
// blast circles 
 
message_beginMSG_BROADCAST,SVC_TEMPENTITY,vec1
 
write_byte21 
 
write_coord(vec1[0]) 
 
write_coord(vec1[1]) 
 
write_coord(vec1[2] + 16
 
write_coord(vec1[0]) 
 
write_coord(vec1[1]) 
 
write_coord(vec1[2] + 1936
 
write_shortwhite 
 
write_byte// startframe 
 
write_byte// framerate 
 
write_byte// life 
 
write_byte16 // width 
 
write_byte// noise 
 
write_byte188 // r 
 
write_byte220 // g 
 
write_byte255 // b 
 
write_byte255 //brightness 
 
write_byte// speed 
 
message_end()
 
//Explosion2 
 
message_beginMSG_BROADCAST,SVC_TEMPENTITY
 
write_byte12 
 
write_coord(vec1[0]) 
 
write_coord(vec1[1]) 
 
write_coord(vec1[2]) 
 
write_byte188 // byte (scale in 0.1's) 
 
write_byte10 // byte (framerate) 
 
message_end()
 
//Smoke 
 
message_beginMSG_BROADCAST,SVC_TEMPENTITY,vec1
 
write_byte
 
write_coord(vec1[0]) 
 
write_coord(vec1[1]) 
 
write_coord(vec1[2]) 
 
write_shortg_sModelIndexSmoke 
 
write_byte)  
 
write_byte10 )  
 
message_end()

slay_blood(vec1[3]) { 
 
//LAVASPLASH 
 
message_beginMSG_BROADCAST,SVC_TEMPENTITY
 
write_byte10 
 
write_coord(vec1[0]) 
 
write_coord(vec1[1]) 
 
write_coord(vec1[2]) 
 
message_end() 

slay_lightning(vec1[3],vec2[3]) { 
 
//Lightning 
 
message_beginMSG_BROADCAST,SVC_TEMPENTITY
 
write_byte
 
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_shortlightning 
 
write_byte// framestart 
 
write_byte// framerate 
 
write_byte// life 
 
write_byte20 // width 
 
write_byte30 // noise 
 
write_byte200 // r, g, b 
 
write_byte200 // r, g, b 
 
write_byte200 // r, g, b 
 
write_byte200 // brightness 
 
write_byte200 // speed 
 
message_end()
 
//Sparks 
 
message_beginMSG_PVSSVC_TEMPENTITY,vec2
 
write_byte
 
write_coordvec2[0] ) 
 
write_coordvec2[1] ) 
 
write_coordvec2[2] ) 
 
message_end()
 
//Smoke     
 
message_beginMSG_BROADCAST,SVC_TEMPENTITY,vec2
 
write_byte
 
write_coord(vec2[0]) 
 
write_coord(vec2[1]) 
 
write_coord(vec2[2]) 
 
write_shortg_sModelIndexSmoke 
 
write_byte10 )  
 
write_byte10 )  
 
message_end()
}
 
public 
plugin_precache() {
 
 
g_sModelIndexSmoke precache_model("sprites/steam1.spr")
 
lightning precache_model("sprites/lgtning.spr")
 
white precache_model("sprites/white.spr")
 
precache_sound"ambience/thunder_clap.wav")
 
precache_sound"weapons/headshot2.wav")
 
precache_sound"weapons/explode3.wav")
 
 return 
PLUGIN_CONTINUE

And everything is fine i can compile it but i dont know how to set id on 0 so all players can see it. Right now only players who die can see it.
Also i want my message show in blue on CTs and show in red on Ts.

Thanks in advance
Bumps are only allowed after 2 weeks. and also please use php and /php tags next time you post your code so we can read

PHP Code:
client_print(indexprint_typeMessage
So setting index to 0
PHP Code:
client_print(0print_chat"my message"
</span></span></span>

Last edited by Doc-Holiday; 11-08-2009 at 14:34.
Doc-Holiday 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 17:31.


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