Raised This Month: $ Target: $400
 0% 

Why this incorrect ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
newcomer
Member
Join Date: Aug 2011
Old 04-21-2012 , 07:58   Why this incorrect ?
Reply With Quote #1

Why it write server name (I want write user name) and can't write teamscore. What did I do wrong

Quote:
#include <amxmodx>
#include <amxmisc>

new kills[33]
new tcount , ctcount

public plugin_init()
{
register_plugin("Ace Log", "1.0", "Newcomer")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_event("DeathMsg", "event_DeathMsg", "a")
register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")
register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")

}

public event_round_start()
{
new reset_value[33]
kills = reset_value
}

public event_DeathMsg()
{
static killer, victim
killer = read_data(1)
victim = read_data(2)
if (!is_user_connected(killer) || !is_user_connected(victim) || killer==victim || get_user_team(killer)==get_user_team(victim)) return;
kills[killer] += 1
if (kills[killer] == 5)
{
ace_log(killer)
}
}
ace_log(killer)
{
new szFile[128];
get_configsdir(szFile,127);
formatex(szFile,127,"%s/ace_log.txt",szFile);

if(!file_exists(szFile))
{
write_file(szFile," ",-1)
}
new name[32],sztime[54],szLog[256],map[33]
get_user_name(killer,name,31);
get_time("%d.%m.%Y -- %H:%M:%S",sztime,53);
get_mapname(map,32);

formatex(szLog,255,"Player: %s | Date: %s | Map: %s | Wins: CT:%s TS:%s",name, sztime, map,ctcount,tcount);
write_file(szFile,szLog,-1);
}

public t_win(id)
{
tcount+=1

}

public ct_win(id)
{
ctcount+=1
}

Last edited by newcomer; 04-23-2012 at 01:21.
newcomer is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-21-2012 , 13:24   Re: Why this incorrect ?
Reply With Quote #2

Because "id" is 0 (aka the server). You can't use any arguments coming from the DeathMsg forward. You need to use "killer" or "victim" which ever name you were trying to get.
__________________
fysiks is offline
newcomer
Member
Join Date: Aug 2011
Old 04-21-2012 , 15:24   Re: Why this incorrect ?
Reply With Quote #3

Yes thanks !!!
And how about with Team Wins ? I tried event "TeamScore" but it not work too.
newcomer is offline
Old 04-21-2012, 16:03
EpicMonkey
This message has been deleted by EpicMonkey.
newcomer
Member
Join Date: Aug 2011
Old 04-21-2012 , 16:41   Re: Why this incorrect ?
Reply With Quote #4

sorry, I can't understand your mean
newcomer is offline
newcomer
Member
Join Date: Aug 2011
Old 04-23-2012 , 01:22   Re: Why this incorrect ?
Reply With Quote #5

Someone please help me, it's nearly complete. Only need write team wins now
newcomer is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-23-2012 , 03:10   Re: Why this incorrect ?
Reply With Quote #6

Quote:
Originally Posted by newcomer View Post
Someone please help me, it's nearly complete. Only need write team wins now
I just searched for "hook win" in the scripting help forum and the first hit was an answer to your question. Please search.
__________________
fysiks is offline
newcomer
Member
Join Date: Aug 2011
Old 04-23-2012 , 22:51   Re: Why this incorrect ?
Reply With Quote #7

not found needed
more info please
newcomer is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-23-2012 , 23:38   Re: Why this incorrect ?
Reply With Quote #8

Quote:
Originally Posted by newcomer View Post
not found needed
more info please
Are you saying you don't know how to search a forum? Also, note that after my last post that the first result is this thread and the second result is the answer to your question.

When you want to search for something in a particular forum you go to that forum and look to the upper right:



If you are observant, you will see that I've done you a favor and did the search for you .
__________________
fysiks is offline
newcomer
Member
Join Date: Aug 2011
Old 04-24-2012 , 00:18   Re: Why this incorrect ?
Reply With Quote #9

omg I know how to search, but I told I'm not found anything need for this problem (used your keyword)


Last edited by newcomer; 04-24-2012 at 00:20.
newcomer is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-24-2012 , 01:05   Re: Why this incorrect ?
Reply With Quote #10

If hooking the sounds isn't working then you can use the method you have been given in the search results instead. Same general concept of what you already have with a different method of detecting when a team wins.
__________________
fysiks 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 07:41.


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