AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   First Blood (https://forums.alliedmods.net/showthread.php?t=50812)

Alka 02-04-2007 07:40

First Blood
 
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:)

[ --<-@ ] Black Rose 02-04-2007 11:40

Re: First Blood
 
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 }

Alka 02-04-2007 12:11

Re: First Blood
 
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"!

[ --<-@ ] Black Rose 02-04-2007 12:24

Re: First Blood
 
client_cmd(0,"spk misc/firstblood2_ultimate.wav")

Alka 02-04-2007 12:31

Re: First Blood
 
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!

[ --<-@ ] Black Rose 02-04-2007 12:44

Re: First Blood
 
amx_fb_mode "ac"

Alka 02-04-2007 12:59

Re: First Blood
 
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! :|

[ --<-@ ] Black Rose 02-04-2007 13:06

Re: First Blood
 
Oh, code fixed.

Alka 02-04-2007 13:36

Re: First Blood
 
Now it doesn't work at all! :| if you can make it work i be thankful!

Phantom Warrior 02-04-2007 17:55

Re: First Blood
 
Will you please post the whole code you have right now.
Use the small tags


All times are GMT -4. The time now is 00:42.

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