Jump to content

[QUESTION] Why not working this script?


Tokio

Recommended Posts

Posted (edited)
1 hour ago, 50cent said:

Lol, now i have a new problem. O.o The script working, but sometimes the /asay xy command does not working, wtf?! O.o When i restart the resource many times then working again, but just for a few minutes, and does not working again. Wtf, how to fix this problem? :o 

No idea. Give debug errors/warnings.

Edited by koragg

G6HYac9.jpg

I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux 
I also love cars

PS I'm friendly

Posted (edited)
local names = {
	["Admin"] = "Tulajdonos",
	["Moderator"] = "Moderátor"
}


function adminuzi(thePlayer, commandName, ...)
	for i,v in pairs(getElementsByType( "player" )) do
        for group, serverGroupName in pairs( names ) do
            if isGuestAccount( getPlayerAccount( v ) ) then return end
		    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group ) then
		    		local message = table.concat({...}, " ")
	                outputChatBox("#0088FF["..serverGroupName.."]#d8001f  "..getPlayerName(v)..":"..message,getRootElement(),0,0,0,true)
                    break
		    end
        end
	end
end
addCommandHandler("asay", adminuzi)

Juste the thing I gave you, but "break" will stop the "for" loop. It should'nt spam anymore

@50cent

Edited by Gordon_G

Gordon#6977

Posted
26 minutes ago, koragg said:

No idea. Give debug errors/warnings.

no errors/warnings O.o

My servers:

Fun:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Derby(DD):

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
2 hours ago, Gordon_G said:

local names = {
	["Admin"] = "Tulajdonos",
	["Moderator"] = "Moderátor"
}


function adminuzi(thePlayer, commandName, ...)
	for i,v in pairs(getElementsByType( "player" )) do
        for group, serverGroupName in pairs( names ) do
            if isGuestAccount( getPlayerAccount( v ) ) then return end
		    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group ) then
		    		local message = table.concat({...}, " ")
	                outputChatBox("#0088FF["..serverGroupName.."]#d8001f  "..getPlayerName(v)..":"..message,getRootElement(),0,0,0,true)
                    break
		    end
        end
	end
end
addCommandHandler("asay", adminuzi)

Juste the thing I gave you, but "break" will stop the "for" loop. It should'nt spam anymore

@50cent

this is not good, because output the text with all player's name.. :S 

My servers:

Fun:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Derby(DD):

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted

Use my code from first page. 

G6HYac9.jpg

I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux 
I also love cars

PS I'm friendly

Posted
11 minutes ago, koragg said:

Use my code from first page. 

i used, but sometimes does not working the cmd :S 

My servers:

Fun:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Derby(DD):

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
10 minutes ago, 50cent said:

i used, but sometimes does not working the cmd :S 

Well it's better than a fully non-working one anyway :D Hope someone can help you, I don't know why it doesn't work from time to time. And nothing in debug...

G6HYac9.jpg

I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux 
I also love cars

PS I'm friendly

Posted
31 minutes ago, koragg said:

Well it's better than a fully non-working one anyway :D Hope someone can help you, I don't know why it doesn't work from time to time. And nothing in debug...

Now i tested on a localhost server, and on localhost server working fine everytime, and just on hosted server not working everytime :S 

My servers:

Fun:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Derby(DD):

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...