Raised This Month: $ Target: $400
 0% 

precaching error -


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 10-05-2006 , 08:07   precaching error -
Reply With Quote #1

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #define PLUGIN "Annoucement messages" #define VERSION "1.0" #define AUTHOR "stigma" new iKill[33] = 0 new bool:FirstBlood new const WickedSickSound[] = "Announce/WhickedSick.wav" new const UnStoppableSound[] = "Announce/Unstoppable.wav" new const UltraKillSound[] = "Announce/UltraKill.wav" new const TripleKillSound[] = "Announce/Triple_kill.wav" new const TeamKillerSound[] = "Announce/Team_Killer.wav" new const SpawnKillerSound[] = "Announce/Spawn_killer.wav" new const ScoreSound[] = "Announce/Score.wav" new const RedDominateSound[] = "Announce/red_team_dominating.wav" new const RampageSound[] = "Announce/Rampage.wav" new const OwnageSound[] = "Announce/Ownage.wav" new const MultiKillSound[] = "Announce/MultiKill.wav" new const MonsterKillSound[] = "Announce/monster_kill.wav" new const KillingSpreeSound[] = "Announce/Killing_Spree.wav" new const HolyShitSound[] = "Announce/HolyShit_F.wav" new const HeadShotSound[] = "Announce/HeadShot.wav" new const HeadHunterSound[] = "Announce/HeadHunter.wav" new const GodLikeSound[] = "Announce/GodLike.wav" new const FirstBloodSound[] = "Announce/first_blood.wav" new const EagleEyeSound[] = "Announce/EagleEye.wav" new const DoubleKillSound[] = "Announce/Double_Kill.wav" new const DominatingSound[] = "Announce/Dominating.wav" new const BlueDominateSound[] = "Announce/blue_team_dominating.wav" public plugin_precache() {     precache_sound(DoubleKillSound) // Sound 2     precache_sound(TripleKillSound) // Sound 3     precache_sound(MultiKillSound) // Sound 5     precache_sound(KillingSpreeSound) // Sound 7     precache_sound(UltraKillSound) // Sound 9     precache_sound(MonsterKillSound) // Sound 10     precache_sound(DominatingSound) // Sound 12     precache_sound(GodLikeSound) // Sound 13     precache_sound(RampageSound) // Sound 15     precache_sound(WickedSickSound) // Sound 17     precache_sound(TeamKillerSound) // Team Mate killed     precache_sound(SpawnKillerSound) // Someone killed within 10 secs     precache_sound(ScoreSound) // Task     precache_sound(RedDominateSound) // Terroists is dominating     precache_sound(OwnageSound) // Team Owning     precache_sound(HolyShitSound) // 1 shot, 2 kill     precache_sound(HeadShotSound) // HeadShot     precache_sound(HeadHunterSound) // AWM Headshot     precache_sound(FirstBloodSound) // First Kill     precache_sound(EagleEyeSound) // Deagle Face     precache_sound(BlueDominateSound) // Counter-Terroists is dominating     precache_sound(UnStoppableSound) } public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("HLTV", "NewRound", "a", "1=0", "2=0")     register_event("DeathMsg","Death","a")     } public NewRound(id) {     FirstBlood = false     client_print(0,print_chat,"%d", iKill[id]) }     public Death(id) {     set_hudmessage(0, 100, 155, 0.00, 0.35, 3, 1.0, 4.0, 0.5, 0.05, 1)         new killer = read_data(1)     new victim = read_data(2)     new headshot = read_data(3)         new WeaponName[20]     new WeaponID = get_weaponid(WeaponName)     read_data(4,WeaponName,19)         new vicname[33]     get_user_name(victim,vicname,32)     new killername[33]     get_user_name(killer,killername,32)         if (get_user_team(killer) == get_user_team(victim)) {         client_cmd(0,"play %s", TeamKillerSound)         show_hudmessage(0,"%s killed a team mate!", killername)         iKill[killer] = 0                 return PLUGIN_HANDLED     }     if (get_user_team(killer) != get_user_team(victim)) {                 if (FirstBlood = false) {             client_cmd(0,"play %s", FirstBloodSound)             FirstBlood = true             iKill[killer] += 1                         set_task(0.1, "HudEvent", id)             return PLUGIN_HANDLED         }         if (headshot) {             client_cmd(0,"play %s", HeadShotSound)             show_hudmessage(id,"Headshot!")             iKill[killer] += 1             set_task(0.1, "HudEvent", id)             return PLUGIN_HANDLED         }         if (WeaponID = CSW_DEAGLE && headshot) {             client_cmd(0,"play %s", EagleEyeSound)             show_hudmessage(id,"%s has an Eagle eye!")             iKill[killer] += 1             set_task(0.1, "HudEvent", id)                         return PLUGIN_HANDLED         }                 iKill[killer] += 1             } } public HudEvent(id) {         set_hudmessage(0, 100, 155, 0.00, 0.40, 3, 1.0, 4.0, 0.5, 0.05, 2)         new killer = read_data(1)         new killername[33]     get_user_name(killer,killername,32)     if (iKill[killer] = 2) {         client_cmd(id,"play %s",DoubleKillSound)         show_hudmessage(id,"Double Kill!")     } else if (iKill[killer] = 3) {         client_cmd(id,"play %s",TripleKillSound)         show_hudmessage(id,"Triple Kill!")     } else if (iKill[killer] = 5) {         client_cmd(id,"play %s",MultiKillSound)         show_hudmessage(id,"Multi Kill!")     } else if (iKill[killer] = 7) {         client_cmd(0,"play %s",KillingSpreeSound)         show_hudmessage(0,"%s is on a Killing Spree!", killername)     } else if (iKill[killer] = 9) {         client_cmd(id,"play %s",UltraKillSound)         show_hudmessage(id,"Ultra Kill!")     } else if (iKill[killer] = 10) {         client_cmd(0,"play %s",MonsterKillSound)         show_hudmessage(0,"M-M-M-MONSTER KILL!!!")     } else if (iKill[killer] = 11) {         client_cmd(0,"play %s",DominatingSound)         show_hudmessage(0,"%s is Dominating!", killername)     } else if (iKill[killer] = 12) {         client_cmd(0,"play %s",GodLikeSound)         show_hudmessage(0,"%s is Godlike!", killername)     } else if (iKill[killer] = 14) {         client_cmd(0,"play %s",RampageSound)         show_hudmessage(0,"%s is on a Rampage!", killername)     } else if (iKill[killer] = 15) {         client_cmd(0,"play %s",WickedSickSound)         show_hudmessage(0,"WHICKED SICK!!!^n%s has killed 15 without dying!", killername)     }     return PLUGIN_CONTINUE }

Last edited by stigma; 10-05-2006 at 09:13.
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 10-05-2006 , 08:54   Re: precaching error -
Reply With Quote #2

use precache_sound instead of generic

but you have to remove the "sound\" part inside of the strings
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
VEN
Veteran Member
Join Date: Jan 2005
Old 10-05-2006 , 09:02   Re: precaching error -
Reply With Quote #3

Not if (x = a) but if (x == a)
VEN is offline
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 10-05-2006 , 09:14   Re: precaching error -
Reply With Quote #4

Yea i found out..

But why does it say double when im killling a teammate now then?

every time i kill one it keep saying double kill. It's like it wont increase the vars. :S
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 10-05-2006 , 09:37   Re: precaching error -
Reply With Quote #5

Also for your Death event function
Code:
public Death(id) { to public Death() { // Since id will be always 0 no matter what. Since no data is sent through that.

Code:
public HudEvent(id) {         set_hudmessage(0, 100, 155, 0.00, 0.40, 3, 1.0, 4.0, 0.5, 0.05, 2)         new killer = read_data(1) // You can't do this here. You only can do it in the event function itself. So you need to pass that data along with set task.
__________________
No private support via Instant Message
GunGame:SM Released

Last edited by teame06; 10-05-2006 at 12:33.
teame06 is offline
Send a message via AIM to teame06
Rolnaaba
Veteran Member
Join Date: May 2006
Old 10-05-2006 , 09:47   Re: precaching error -
Reply With Quote #6

if you use set task to move to the HudEvent, the read_data ID's are passed along to the task set? does all variables declared move along the set_task or do just the ability to use read_data to reset a variable with the correct information?
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 10-05-2006 , 12:31   Re: precaching error -
Reply With Quote #7

@ Rolnaaba

No. You need to use the availble part of set_task to pass the argument through.. Since he need to pass more than 1 arugment. He can't use the taskid slot to pass it through.

Code:
     new Oranges[3];      Oranges[0] = killer;      Oranges[1] = victim;      set_task(0.1, "HudEvent", _, Oranges, 3); // Then his function would look like this      public HudEvent(param[])      {           //           new killer = param[0];           new victim = param[1];      }
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 10-05-2006 , 13:21   Re: precaching error -
Reply With Quote #8

Why wont the HUD messages appear? :S
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 10-05-2006 , 14:53   Re: precaching error -
Reply With Quote #9

Code:
public HudEvent(id) {         set_hudmessage(0, 100, 155, 0.00, 0.40, 3, 1.0, 4.0, 0.5, 0.05, 2)         new killer = read_data(1) // Will be 0 no matter waht.         new killername[33]     get_user_name(killer,killername,32)     // Since you do not understand that i'm telling you. You are passing the id of zero to the HudEvent Function.     //So since killer is 0 ... then iKill[0] is zero. Your not passing no player real id. Your passing the server id which is 0.     if (iKill[killer] = 2) {     // So your IF statements are always failing
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 10-05-2006 , 16:29   Re: precaching error -
Reply With Quote #10

Okay..

Well i've changed it to this:

Code:
public Death() {     set_hudmessage(0, 100, 155, 0.05, 0.35, 3, 1.0, 4.0, 0.5, 0.05, -1)         new killer = read_data(1)     new victim = read_data(2)         new WeaponName[20]     new WeaponID = get_weaponid(WeaponName)     read_data(4,WeaponName,19)         new vicname[33]     get_user_name(victim,vicname,32)     new killername[33]     get_user_name(killer,killername,32)         if (get_user_team(killer) == get_user_team(victim)) {         client_cmd(0,"play %s", TeamKillerSound)         show_hudmessage(0,"%s killed a team mate!", killername)         iKill[killer] = 0                 return PLUGIN_HANDLED     }     if (get_user_team(killer) != get_user_team(victim)) {                 if (read_data(3) && FirstBlood == true && WeaponID != CSW_DEAGLE) {             client_cmd(0,"play %s", HeadShotSound)             show_hudmessage(killer,"Headshot!")         }         if (WeaponID == CSW_DEAGLE && read_data(3) && FirstBlood == true) {             client_cmd(0,"play %s", EagleEyeSound)             show_hudmessage(killer,"%s has an Eagle eye!")         }                 if (FirstBlood == false) {             client_cmd(0,"play %s", FirstBloodSound)             show_hudmessage(0,"%s drew First Blood!", killername)             FirstBlood = true         }             iKill[killer] += 1     }     if (iKill[killer] == 2) {         client_cmd(killer,"play %s",DoubleKillSound)         show_hudmessage(killer,"Double Kill!")     } else if (iKill[killer] == 3) {         client_cmd(killer,"play %s",TripleKillSound)         show_hudmessage(killer,"Triple Kill!")     } else if (iKill[killer] == 5) {         client_cmd(killer,"play %s",MultiKillSound)         show_hudmessage(killer,"Multi Kill!")     } else if (iKill[killer] == 7) {         client_cmd(0,"play %s",KillingSpreeSound)         show_hudmessage(0,"%s is on a Killing Spree!", killername)     } else if (iKill[killer] == 9) {         client_cmd(killer,"play %s",UltraKillSound)         show_hudmessage(killer,"Ultra Kill!")     } else if (iKill[killer] == 10) {         client_cmd(0,"play %s",MonsterKillSound)         show_hudmessage(0,"M-M-M-MONSTER KILL!!!")     } else if (iKill[killer] == 11) {         client_cmd(0,"play %s",DominatingSound)         show_hudmessage(0,"%s is Dominating!", killername)     } else if (iKill[killer] == 12) {         client_cmd(0,"play %s",GodLikeSound)         show_hudmessage(0,"%s is Godlike!", killername)     } else if (iKill[killer] == 14) {         client_cmd(0,"play %s",RampageSound)         show_hudmessage(0,"%s is on a Rampage!", killername)     } else if (iKill[killer] == 15) {         client_cmd(0,"play %s",WickedSickSound)         show_hudmessage(0,"WHICKED SICK!!!^n%s has killed 15 without dying!", killername)     }     return PLUGIN_HANDLED }

The messages aint appearing anyway.. And no other HUD messages aint shown at the same time..


By the way, i noticed nightsreem's plugin called "Player wanted", han can he make his own native "getMostKills(team)", and then return the user who have killed most people?
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
Reply


Thread Tools
Display Modes

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 04:59.


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