-
Posts
827 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Cadu12
-
Learn LUA, this is hardcore for you (if you use custom).
-
You have to edit in "race/racevoting_server.lua".
-
I made it looooong time. Client-side: MessagesTable = {} function SCreateMessages(str) table.insert(MessagesTable, {str, 255, false}) if #MessagesTable >= 11 then table.remove(MessagesTable, 1) end end addEvent( "onCreateMessages", true ) addEventHandler( "onCreateMessages", getRootElement(), SCreateMessages ) function onMessagesReader() local screenx, screeny = guiGetScreenSize() for i, v in ipairs(MessagesTable) do if v[2] <= 255 and v[3] == false then if v[2] <= 0 then v[3] = true else v[2] = v[2] - 0.50 end end dxDrawColorTextM(string.gsub(v[1], '#%x%x%x%x%x%x', '#000000'), 1+(((screenx-20)-(dxGetTextWidth(string.gsub(v[1], '#%x%x%x%x%x%x', ''),(screenx/1024)*1.2,"default-bold")))/1024)*screenx, 1+((250 + dxGetFontHeight(1.2,"default-bold") * (i - 1))/768)*screeny, 1+(((screenx-20)-(dxGetTextWidth(string.gsub(v[1], '#%x%x%x%x%x%x', ''),(screenx/1024)*1.2,"default-bold")))/1024)*screenx, 1+((250 + dxGetFontHeight(1.2,"default-bold") * (i - 1))/768)*screeny, tocolor(0,0,0,v[2]), (screenx/1024)*1.2, "default-bold", v[2]) dxDrawColorTextM(v[1], (((screenx-20)-(dxGetTextWidth(string.gsub(v[1], '#%x%x%x%x%x%x', ''),(screenx/1024)*1.2,"default-bold")))/1024)*screenx, ((250 + dxGetFontHeight(1.2,"default-bold") * (i - 1))/768)*screeny, (((screenx-20)-(dxGetTextWidth(string.gsub(v[1], '#%x%x%x%x%x%x', ''),(screenx/1024)*1.2,"default-bold")))/1024)*screenx, ((250 + dxGetFontHeight(1.2,"default-bold") * (i - 1))/768)*screeny, tocolor(255,255,255,v[2]), (screenx/1024)*1.2, "default-bold", v[2]) end end addEventHandler("onClientRender", getRootElement(), onMessagesReader) function dxDrawColorTextM(str, ax, ay, bx, by, color, scale, font, alpha) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), alpha) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth( cap, scale, font) dxDrawText(cap, ax, ay, ax + w , by, color, scale, font, "center", "bottom", false, false, false ) ax = ax + w color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), alpha) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w , by, color, scale, font, "center", "bottom", false, false, false ) end end Server-side: function CreateMessages(str) triggerClientEvent ( getRootElement(), "onCreateMessages", getRootElement(), str) end function onJoinPlayerMessages() triggerClientEvent ( getRootElement(), "onCreateMessages", getRootElement(), "#ffffff" .. getPlayerName(source) .. "#60f8ff has joined the server from: #00ff00" .. getPlayerFlag(source)) end addEventHandler('onPlayerJoin', getRootElement(), onJoinPlayerMessages) function onPlayerChangeNickMessages(old, new) triggerClientEvent ( getRootElement(), "onCreateMessages", getRootElement(), "#ffffff" .. old .. "#60f8ff is now known as #ffffff " .. new) end addEventHandler('onPlayerChangeNick', getRootElement(), onPlayerChangeNickMessages) function onQuitPlayerMessages(reason) triggerClientEvent ( getRootElement(), "onCreateMessages", getRootElement(), "#ffffff" .. getPlayerName(source) .. "#60f8ff has left the server [#ffffff" .. reason .. "#60f8ff]") end addEventHandler('onPlayerQuit', getRootElement(), onQuitPlayerMessages) function onPlayerLoginMessages() triggerClientEvent ( getRootElement(), "onCreateMessages", getRootElement(), "#ffffff" .. getPlayerName(source) .. "#60f8ff has logged in!") end addEventHandler('onPlayerLogin', getRootElement(), onPlayerLoginMessages) function serverside: CreateMessages( string ) function clientside: SCreateMessages( string )
-
@Solidsnake14: Remove "not" from "if", else it will use godmode with guest or without admin.
-
Y U NO USE ADDONS TO Syntax Highlighting in MS2010? (Not free)
-
local randomMusics = musicURL[math.random(#musicURL)] Try again.
-
Are you using GUI or Custom GUI? If you are using GUI, use destroyElement and create gui it again. (guiSetVisible stays high memory)
-
GameServers4You, for all your gameserver needs.
Cadu12 replied to GameServers4You's topic in Hosting solutions
This host is very good, but I have problem with OneBip that I can't getting money... -
It is possible, use callRemote, PHP and setTimer every time.
-
On: Good job MTA TEAM Off: Audifire, AeroXbird and MIKI785: <script src="yournamefiles.lua" type="client" protected="true"/>
-
I know this guy, sora+ is not known as SoRa. I can remember this sora+, I did join FFS server, I got his message "joinquit" it says sora+ from US.
-
John, he want visible for all player, not local. PS: Did you saw my post or not?
-
http://youripservermta:22005
-
-- SERVER SIDE -- function onCountdown(player) for i=1, 11 do setTimer(triggerClientEvent, i*1000, 1, getRootElement(), "onSetCountdown", getRootElement(), i) end end addCommandHandler("countdown", onCountdown) -- CLIENT SIDE -- local screenWidth, screenHeight = guiGetScreenSize() local showhide = false local countdown = 0 function onRenderCountdown() if showhide then if countdown == 10 then dxDrawImage(screenWidth/2 - 320, screenWidth/2 - 81, 320, 81, "images/go.png") else dxDrawImage(screenWidth/2 - 110, screenWidth/2 - 190, 110, 190, "images/" .. countdown .. ".png") end end end addEventHandler("onClientRender", getRootElement(), onRenderCountdown) function onSetCountdown(count) if count < 11 then countdown = count showhide = true else showhide = false end end addEvent("onSetCountdown", true) addEventHandler("onSetCountdown", getRootElement(), onSetCountdown) I didnt tested yet.
-
Happy birthday Blokker!
-
I got idea, so you can create group?
-
Nice one, good idea.
-
Hmmm, it can be send in other server? If you are using callRemote and Database?
-
https://wiki.multitheftauto.com/wiki/DxDrawText Client-only function
-
viewtopic.php?f=119&t=31346 I dont tinhk so.
-
Wrong, myonlake. bool redirectPlayer ( player thePlayer, string serverIP, int serverPort, [ string serverPassword ] Port must be in a integer only.
-
function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY, alpha) if alignX then if alignX == "center" then local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) ax = ax + (bx-ax)/2 - w/2 elseif alignX == "right" then local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) ax = bx - w end end if alignY then if alignY == "center" then local h = dxGetFontHeight(scale, font) ay = ay + (by-ay)/2 - h/2 elseif alignY == "bottom" then local h = dxGetFontHeight(scale, font) ay = by - h end end local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), tonumber("0x"..col:sub(7, 8)), alpha or 255) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), tonumber("0x"..col:sub(7, 8)), alpha or 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) end end
-
https://community.multitheftauto.com/index.php?p= ... ls&id=3202 https://community.multitheftauto.com/index.php?p= ... &id=302622 Reason: viewtopic.php?f=91&t=38529 Proof1: viewtopic.php?f=91&t=38529&p=395882#p395862 Proof2: http://i39.tinypic.com/149qbsz.png