Forum

> > CS2D > Scripts > Script will only work on a local server
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Script will only work on a local server

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Script will only work on a local server

Hajt
User Off Offline

Zitieren
script
1
2
3
4
5
6
7
8
function server.standard.say(id,txt)
	for _, usgn in ipairs(server.standard.admins) do
		if (player(id,'usgn')==usgn) then
			msg(string.char(169).."000255000"..player(id,"name").." [admin]: "..string.char(169).."255220000"..txt)
			return 1
		end
	end
end

local server
IMG:https://cs2d.xaa.pl/images/screens/test1.png


dedicated server
IMG:https://cs2d.xaa.pl/images/screens/test2.png

alt Re: Script will only work on a local server

Fehu
User Off Offline

Zitieren
What is wrong with PL people? Teh fck.. lol
I can't understand you.. Nobody can..

//Ah I didn't saw screenshots. But.. Still I can't help you. Maybe you used another SAY HOOK without return?

alt Re: Script will only work on a local server

Gajos
BANNED Off Offline

Zitieren
It's an error in the script. I have never had such a problem.
Stop copy and edit scripts.

PS. Na unlimited construction moge wam napisac lua.

EDIT:
On the picture local server we can't see hudtxt2's text.
3× editiert, zuletzt 30.12.13 22:12:31

alt Re: Script will only work on a local server

Avo
User Off Offline

Zitieren
The answer is simple. There are two functions hooked to hook "say". Read about priorities.
Zitat
Priority is only important if there is more than one function attachted to the same hook!
Default is 0, higher numbers = higher priority, lower numbers (also negative) = lower priority.
The attached function with the HIGHEST priority is the LAST function which will be executed.
Moreover CS2D will take the return value of this function (if there is any)!
In most cases you will just omit the priority parameter (yes, it is [optional])!

addhook("say", "server.standard.say", 9999)

Btw, do you use my script from cartel's server?
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht