Raised This Month: $ Target: $400
 0% 

First Blood


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 02-04-2007 , 07:40   First Blood
Reply With Quote #1

Hi This a plugin from AMX And i want to make it for AMXX I change #include <amxmodx> but give me an error =>>
Code:
 
L 02/04/2007 - 13:47:56: [AMXX] Displaying debug trace (plugin "firstblood.amxx")
L 02/04/2007 - 13:47:56: [AMXX] Run time error 10: native error (native "pause")
L 02/04/2007 - 13:47:56: [AMXX]    [0] php4HxP1M.sma::plugin_init (line 95)
This is the plugin =>>


PHP Code:
/* AMX Mod script. 

* AMX Firstblood Plugin 

* (c) Copyright 2002-2003, sonic '[email protected]'
* This file is provided as is (no warranties). 

*/ 
/*  Put in server.cfg: 

*   amx_fb_mode < flags > 
*   "a" - show firstblood msg in hud 
*   "b" - show firstblood msg in chat 
*   "c" - play firstblood sound 
*   "d" - show attacker @ fistblood msg 
*   "e" - set firstblood msg to damage_event (default death_event)

*   Set amx_fb_mode "" to disable fistblood plugin 
*   Default amx_fb_mode is "ac" 
*/ 
#include <amxmodx> 
public new_round() { 
   if ((
get_cvar_num("mp_roundtime") * 60) == read_data(1)) {
      new 
fbmode[8
      
get_cvar_string("amx_fb_mode",fbmode,7
      new 
fbmode_bit read_flags(fbmode
      if (
fbmode_bit 16) {
         
unpause("b","damage_msg"
      }
      else
         
unpause("b","death_msg"
   }
   return 
PLUGIN_CONTINUE 

public 
death_msg() { 
   new 
aIndex read_data(1
   new 
vIndex read_data(2
   if ( !
aIndex || aIndex==vIndex || get_user_team(aIndex)==get_user_team(vIndex)) 
      return 
PLUGIN_CONTINUE 
   fb_event
(aIndex,vIndex)
   
pause("b","death_msg")
   return 
PLUGIN_CONTINUE 

public 
damage_msg() {
   new 
vIndex read_data(0)
   new 
aIndex get_user_attacker(vIndex)
   
   if ( !
aIndex || aIndex==vIndex || get_user_team(aIndex)==get_user_team(vIndex)) 
      return 
PLUGIN_CONTINUE 
   fb_event
(aIndex,vIndex)
   
pause("b","damage_msg")
   return 
PLUGIN_CONTINUE 
}
public 
fb_event(aIndex,vIndex) {
   new 
msg[128], fbmode[8
   
get_cvar_string("amx_fb_mode",fbmode,7
   new 
fbmode_bit read_flags(fbmode
       
   if (
fbmode_bit 8) { 
      new 
aName[32
      
get_user_name(aIndex,aName,31
      
format(msg,127,"%s: First Blood!",aName
   } 
   else 
      
format(msg,127,"First Blood!"
       
   if (
fbmode_bit 1) { 
      
set_hudmessage(220,80,100,-1.0,0.30,06.05.01.02.02
      
show_hudmessage(0,msg
   } 
   if (
fbmode_bit 2)   client_print(0,print_chat,"[AMXX] %s",msg
   if (
fbmode_bit 4)   client_cmd(0,"spk misc/firstblood2_ultimate")
   return 
PLUGIN_CONTINUE
}

public 
plugin_init() { 
   
register_plugin("FirstBlood","0.9.3","Sonic ([email protected])")
   
register_event("RoundTime""new_round""bc")
   
register_event("DeathMsg","death_msg","a")
   
register_event("Damage""damage_msg","b","2!0","4!0")
   
register_cvar("amx_fb_mode","ace"
   
pause("b","death_msg"
   
pause("b","damage_msg")
   return 
PLUGIN_CONTINUE 

Thanks in advanced
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-04-2007 , 11:40   Re: First Blood
Reply With Quote #2

Code:
#include <amxmodx> new bool:g_death_msg, bool:g_damage_msg public new_round() {     if ((get_cvar_num("mp_roundtime") * 60) == read_data(1)) {         new fbmode[8]         get_cvar_string("amx_fb_mode",fbmode,7)         new fbmode_bit = read_flags(fbmode)         if (fbmode_bit & 16) {             g_death_msg = true         }         else             g_damage_msg = true     }     return PLUGIN_CONTINUE } public death_msg() {     if ( !g_death_msg )         return PLUGIN_CONTINUE     new aIndex = read_data(1)     new vIndex = read_data(2)     if ( !aIndex || aIndex==vIndex || get_user_team(aIndex)==get_user_team(vIndex))         return PLUGIN_CONTINUE     fb_event(aIndex,vIndex)     g_death_msg = false     return PLUGIN_CONTINUE } public damage_msg() {     if ( !g_damage_msg )         return PLUGIN_CONTINUE     new vIndex = read_data(0)     new aIndex = get_user_attacker(vIndex)         if ( !aIndex || aIndex==vIndex || get_user_team(aIndex)==get_user_team(vIndex))         return PLUGIN_CONTINUE     fb_event(aIndex,vIndex)     g_damage_msg = false     return PLUGIN_CONTINUE } public fb_event(aIndex,vIndex) {     new msg[128], fbmode[8]     get_cvar_string("amx_fb_mode",fbmode,7)     new fbmode_bit = read_flags(fbmode)         if (fbmode_bit & 8) {         new aName[32]         get_user_name(aIndex,aName,31)         format(msg,127,"%s: First Blood!",aName)     }     else         format(msg,127,"First Blood!")         if (fbmode_bit & 1) {         set_hudmessage(220,80,100,-1.0,0.30,0, 6.0, 5.0, 1.0, 2.0, 2)         show_hudmessage(0,msg)     }     if (fbmode_bit & 2)   client_print(0,print_chat,"[AMXX] %s",msg)     if (fbmode_bit & 4)   client_cmd(0,"spk misc/firstblood2_ultimate")     return PLUGIN_CONTINUE } public plugin_init() {     register_plugin("FirstBlood","0.9.3","Sonic ([email protected])")     register_event("RoundTime", "new_round", "bc")     register_event("DeathMsg","death_msg","a")     register_event("Damage", "damage_msg","b","2!0","4!0")     register_cvar("amx_fb_mode","ace")     return PLUGIN_CONTINUE }

Last edited by [ --<-@ ] Black Rose; 02-04-2007 at 13:06.
[ --<-@ ] Black Rose is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 02-04-2007 , 12:11   Re: First Blood
Reply With Quote #3

thanks but it's not working......every time when i hit somebody tell "First Blood" but i wanna be like in stats me first time when i hit somebody tells First Blood and play sound!

Btw I use "KillStreak Advanced" But That First blood doesn't work! [when i kill is working] not when i hit a player is tell "FIRST BLOOD"!
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 02-04-2007 at 12:14.
Alka is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-04-2007 , 12:24   Re: First Blood
Reply With Quote #4

client_cmd(0,"spk misc/firstblood2_ultimate.wav")
[ --<-@ ] Black Rose is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 02-04-2007 , 12:31   Re: First Blood
Reply With Quote #5

yes....But i want a plugin like stats me!with first blood! when you hit somebody for the first time in round write "FIRST BLOOD" and play a sound!
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-04-2007 , 12:44   Re: First Blood
Reply With Quote #6

amx_fb_mode "ac"
[ --<-@ ] Black Rose is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 02-04-2007 , 12:59   Re: First Blood
Reply With Quote #7

The plugin its working But u don't understand something! I want to dislpay that msg and play that sound FIRST TIME WHEN I HIT A PLAYER! But now the plugin tell irst Blood every time whe i hit a player!
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-04-2007 , 13:06   Re: First Blood
Reply With Quote #8

Oh, code fixed.
[ --<-@ ] Black Rose is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 02-04-2007 , 13:36   Re: First Blood
Reply With Quote #9

Now it doesn't work at all! if you can make it work i be thankful!
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 02-04-2007 at 14:00.
Alka is offline
Phantom Warrior
BANNED
Join Date: Feb 2007
Location: hello, gaben
Old 02-04-2007 , 17:55   Re: First Blood
Reply With Quote #10

Will you please post the whole code you have right now.
Use the small tags
Phantom Warrior 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 00:42.


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