et_print problem

Discussions about ET modding (sdk code, player/weapon modeling)

Moderators: Forum moderators, developers

Post Reply
crazyfrag
Posts: 105
Joined: Fri Oct 01, 2004 1:17 pm

et_print problem

Post by crazyfrag »

i want to catch out a vote form the logfile but it does not work can u help me with this (the code down is just 4 testing)

Code: Select all

--broadcast: print "^dMe^6Nina^7 called a vote.  Voting for: Change map to oasis\n"

function ParseString(inputString)
	local i = 1
	local t = {}
	for w in string.gfind(inputString, "([^%s]+)%s*") do
		t[i]=w
		i=i+1
	end
	return t
 end

function et_Print(text)
 	local sound =  "sound/etpro/osp_fight.wav" 
	 local t = ParseString(text)
     if t[1] == "broadcast:" and t[12] == "oasis" then --i tried oasis and oasis\n but both wont work
			et.G_globalSound( sound )
       end
end
Micha!
Posts: 17
Joined: Thu Oct 23, 2008 8:01 am

Post by Micha! »

Ehm you want the player name in the vote?

:D
User avatar
X-DOS
Posts: 19
Joined: Sat May 17, 2008 8:41 pm
Location: United World
Contact:

Post by X-DOS »

How about:
oasis\\n\"
Always you can check what's there by printing out the t[12]
crazyfrag
Posts: 105
Joined: Fri Oct 01, 2004 1:17 pm

Post by crazyfrag »

i tried with t1 only but its not working... and i don`t know why...

but if i read out "cant find map mapname" its working...
User avatar
X-DOS
Posts: 19
Joined: Sat May 17, 2008 8:41 pm
Location: United World
Contact:

Post by X-DOS »

Bad news.
I have done some research, and it's impossible to get messages with "broadcast" - i don't know why.
Try to printout whole 'text' variable - there will not be "broadcast" messages at all
crazyfrag
Posts: 105
Joined: Fri Oct 01, 2004 1:17 pm

Post by crazyfrag »

hmn.. ok :(

i send a chat massage when a client calls a specified vote the prob is that if he has called his maximum number of votes the message is broadcasted... same for if someone already called that vote...
i wanted to read out that the vote has been called and then send the message ...
any idea?
User avatar
Father
Posts: 107
Joined: Sat Jul 22, 2006 1:30 pm
Location: Czech Republic
Contact:

Post by Father »

Then make your checks inside et_ClientCommand
Good example is Hadr0's minipb.lua @ WolfWiki
If you don't do it, someone else will.
Post Reply