Jump to content

Why not working this dx script?


Turbe$Z

Recommended Posts

Posted
local screenW, screenH = guiGetScreenSize()

addEventHandler("onClientRender", root,
    function()
        dxDrawRectangle(screenW * 0.7951, screenH * 0.1944, screenW * 0.1979, screenH * 0.1033, tocolor(0, 0, 0, 131), false)
    end
)

function greetPlayer ( )
	local joinedPlayerName = getPlayerName ( source )
	dxDrawText("#00baff" .. joinedPlayerName .. "#FFffFFJött Kockulni!", 1151, 181, 1420, 202, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, true, false)
end
addEventHandler ( "onPlayerJoin", getRootElement(), greetPlayer )

 

My Fun server:

560x95_FFFFFF_FF9900_000000_000000.png

My DD server:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
5 minutes ago, loki2143 said:

onPlayerJoin is client side 

Server side not client side

You can use onClientPlayerJoin

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
7 minutes ago, Turbo777 said:

onClientPlayerJoin is show word for 1ms and hide, why?

Put the dxDrawText inside "onClientRender" event and use setTimer to hide the player name.

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
1 minute ago, Turbo777 said:

why hide?

Read the last post 

2 minutes ago, Walid said:

Put the dxDrawText inside "onClientRender" event and use setTimer to hide the player name.

 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
local screenW, screenH = guiGetScreenSize()

addEventHandler("onClientRender", root,

    function()
        dxDrawRectangle(screenW * 0.7951, screenH * 0.1944, screenW * 0.1979, screenH * 0.1033, tocolor(0, 0, 0, 131), false)
	end
	
	function greetPlayer()
		dxDrawText("#00baff" .. getPlayerName(source) .. " #FFffFFJött Kockulni!", 1151, 181, 1420, 202, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", true)
	end
addEventHandler ( "onClientPlayerJoin", getRootElement(), greetPlayer )
)

why not working this?

My Fun server:

560x95_FFFFFF_FF9900_000000_000000.png

My DD server:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted (edited)
local screenW, screenH = guiGetScreenSize()

addEventHandler("onClientRender", root,
    function()
        if joinedPlayerName then 
            dxDrawRectangle(screenW * 0.7951, screenH * 0.1944, screenW * 0.1979, screenH * 0.1033, tocolor(0, 0, 0, 131), false)
            dxDrawText("#00baff" .. joinedPlayerName .. "#FFffFFJött Kockulni!", 1151, 181, 1420, 202, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, true, false)
        end 
    end
)

function greetPlayer ( )
	joinedPlayerName = getPlayerName (source)
	setTimer ( function()
		joinedPlayerName = nil
	end, 5000, 1 )
end
addEventHandler ( "onClientPlayerJoin", getRootElement(), greetPlayer)

Untested (i'm using the phone)

Edited by Walid

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
16 minutes ago, Walid said:

local screenW, screenH = guiGetScreenSize()

addEventHandler("onClientRender", root,
    function()
        if joinedPlayerName then 
            dxDrawRectangle(screenW * 0.7951, screenH * 0.1944, screenW * 0.1979, screenH * 0.1033, tocolor(0, 0, 0, 131), false)
            dxDrawText("#00baff" .. joinedPlayerName .. "#FFffFFJött Kockulni!", 1151, 181, 1420, 202, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, true, false)
        end 
    end
)

function greetPlayer ( )
	joinedPlayerName = getPlayerName (source)
	setTimer ( function()
		joinedPlayerName = nil
	end, 5000, 1 )
end
addEventHandler ( "onClientPlayerJoin", getRootElement(), greetPlayer)

Untested (i'm using the phone)

working :DD but, how to add more lines?

My Fun server:

560x95_FFFFFF_FF9900_000000_000000.png

My DD server:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
4 minutes ago, Turbo777 said:

working :DD but, how to add more lines?

use \n to insert a newline.

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
12 minutes ago, Walid said:

use \n to insert a newline.

i know this, but this doesn't add new join message :S

My Fun server:

560x95_FFFFFF_FF9900_000000_000000.png

My DD server:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
1 minute ago, Turbo777 said:

i know this, but this doesn't add new join message :S

You need to use tables

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

 

3 minutes ago, Turbo777 said:

i tried but not good :/

Donate 5$ to MTA (Click Me) and i will do it for you. :P or try to do it by yourself then post your code here.

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted (edited)
21 minutes ago, Walid said:

 

Donate 5$ to MTA (Click Me) and i will do it for you. :P or try to do it by yourself then post your code here.

local screenW, screenH = guiGetScreenSize()

addEventHandler("onClientRender", root,
    function()
            dxDrawRectangle(screenW * 0.7951, screenH * 0.1944, screenW * 0.1979, screenH * 0.1033, tocolor(0, 0, 0, 131), false)
        if join or asd then 
            dxDrawText("#00baff" .. join .. " #FFffFFJött Kockulni!", 1151, 181, 1420, 202, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, true, false)
            dxDrawText("#00baff" .. quit .. " #DF6464Távozott!", 1151, 181, 1420, 202, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, true, false)
		elseif join1 or quit1 then
            dxDrawText("#00baff" .. join1 .. " #FFffFFJött Kockulni!", 1151, 201, 1430, 217, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, true, false)
            dxDrawText("#00baff" .. quit1 .. " #DF6464Távozott!", 1151, 201, 1430, 217, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, true, false)
		elseif join2 or quit2 then
            dxDrawText("#00baff" .. join2 .. " #FFffFFJött Kockulni!", 1151, 222, 1422, 239, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, true, false)
            dxDrawText("#00baff" .. quit2 .. " #DF6464Távozott!", 1151, 222, 1422, 239, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, true, false)
        end 
    end
)

function greetPlayer ( )
	join = getPlayerName (source)
	join1 = getPlayerName (source)
	join2 = getPlayerName (source)
	--setTimer ( function()
		--joinedPlayerName = nil
	--end, 5000, 1 )
end
addEventHandler ( "onClientPlayerJoin", getRootElement(), greetPlayer)

function greetPlayer7 ( )
	quit = getPlayerName (source)
	quit1 = getPlayerName (source)
	quit2 = getPlayerName (source)
	--setTimer ( function()
		--joinedPlayerName = nil
	--end, 5000, 1 )
end
addEventHandler ( "onClientPlayerQuit", getRootElement(), greetPlayer7)

i tried this but not good :S

Edited by Turbo777

My Fun server:

560x95_FFFFFF_FF9900_000000_000000.png

My DD server:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
2 minutes ago, Turbo777 said:

i tried this but not good

As i told you, you need to use Tables

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted (edited)

All what you need is: (stop asking for ready codes)

 

Edited by Walid

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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...