-
Posts
905 -
Joined
-
Last visited
Everything posted by TwiX!
-
try my code you call trigger for ALL and send to client double players example player = MIKI785 so in client code will outputChatBox ('guy '..getPlayerName(thePlayer)..' copy '..getPlayerName(doublePlayer),getRootElement(),255,255,255,true) Will guy MIKI785 copy MIKI785 why you need it?
-
triggerClientEvent(getRootElement(), "onPlayerWinTheRace", player, player) Why you need send two times 1 player? function yourFunctionHere ( thePlayer,doublePlayer ) --Your code Here end addEvent( "onPlayerWinTheRace", true ) addEventHandler( "onPlayerWinTheRace", getRootElement(), yourFunctionHere )
-
why you want copy boss system? ;D try my code, hope you will understand server-side Hunters = 0 onReachedHunter = false function checkingNow(theGuy) if getElementData(theGuy,"state") == "alive" then if getElementData (theGuy,"onHaveCount") == false then Hunters = Hunters + 1 setElementData (theGuy,"onHaveCount",true) onReachedHunter = true end end end function checkForHunters(number,sort,model) if sort == "vehiclechange" then if model == 425 then setTimer(checkingNow,200,1,source) end end end addEventHandler("onPlayerPickUpRacePickup",getRootElement(),checkForHunters) function checkForOneAlive() local alivePlayers = getAlivePlayers() if getElementData (source,"onHaveCount") == true then Hunters = Hunters - 1 end if Hunters == 1 and onReachedHunter == true and #alivePlayers == 1 then triggerEvent ( "StartMap", getRootElement()) end end addEventHandler("onPlayerWasted", getRootElement(), checkForOneAlive) addEvent("onMapStarting") addEventHandler("onMapStarting", getRootElement(), function(mapInfo, mapOptions, gameOptions) Hunters = 0 onReachedHunter = false for i,thePlayers in ipairs(getElementsByType("player")) do setElementData(thePlayers, "onHaveCount", false) end end ) don't steal this code and not publish it as your own
-
in your code he too will got error localPlayer in your code.. argument is undefined localPlayer is part of the predefined variables in MTA: Predefined_variables_list exactly, i forgot it
-
in your code he too will got error localPlayer in your code.. argument is undefined
-
on client-side script don't know what it's "pPlayer"
-
getGroundPosition Client-Side ONLY function fnRoll() local nX, nY, nZ = tonumber(getElementPosition( getLocalPlayer())); outputChatBox( tonumber(getGroundPosition( nX, nY, nZ )) ); setTimer( fnRoll, 1000, 0 ); end addCommandHandler( 'test', fnRoll );
-
1)race_client.lua 2)base.lua 3)race_client.lua 4)race_server.lua
-
same code as in ffs script + name triggers..
-
use this textlib.lua: http://www.mediafire.com/?n8a7f7n8xoddoem
-
you stole script from ffs race, we won't help you
-
open your textlib.lua in race find there line 187 like: addEventHandler ( "onClientRender", getRootElement(), function() for self,_ in pairs(visibleText) do replace on this code: addEventHandler ( "onClientRender", getRootElement(), function() for self,_ in pairs(visibleText) do while true do if self.bDestroyed then visibleText[self] = nil break end if self.tColor[4] < 1 then break end local l,t,r,b --If we arent using a bounding box if not self.tBoundingBox then --Decide if we use relative or absolute local p_screenX,p_screenY = 1,1 if self.bRelativePosition then p_screenX,p_screenY = g_screenX,g_screenY end local fX,fY = (self.fX)*p_screenX,(self.fY)*p_screenY if self.bHorizontalAlign == "left" then l = fX r = fX + g_screenX elseif self.bHorizontalAlign == "right" then l = fX - g_screenX r = fX else l = fX - g_screenX r = fX + g_screenX end if self.bVerticalAlign == "top" then t = fY b = fY + g_screenY elseif self.bVerticalAlign == "bottom" then t = fY - g_screenY b = fY else t = fY - g_screenY b = fY + g_screenY end elseif type(self.tBoundingBox) == "table" then local b_screenX,b_screenY = 1,1 if self.bRelativeBoundingBox then b_screenX,b_screenY = g_screenX,g_screenY end l,t,r,b = self.tBoundingBox[1],self.tBoundingBox[2],self.tBoundingBox[3],self.tBoundingBox[4] l = l*b_screenX t = t*b_screenY r = r*b_screenX b = b*b_screenY end local type,att1,att2,att3,att4,att5 = self:type() if type == "border" or type == "stroke" then att2 = att2 or 0 att3 = att3 or 0 att4 = att4 or 0 att5 = att5 or self.tColor[4] outlinesize = att1 or 2 if outlinesize > 0 then for offsetX=-outlinesize,outlinesize,outlinesize do for offsetY=-outlinesize,outlinesize,outlinesize do if not (offsetX == 0 and offsetY == 0) then dxDrawText(string.gsub(self.strText, '#%x%x%x%x%x%x', ''), l + offsetX, t + offsetY, r + offsetX, b + offsetY, tocolor(att2, att3, att4, att5), self.fScale, self.strFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI ) end end end end elseif type == "shadow" then local shadowDist = att1 att2 = att2 or 0 att3 = att3 or 0 att4 = att4 or 0 att5 = att5 or self.tColor[4] dxDrawText(string.gsub(self.strText, '#%x%x%x%x%x%x', ''), l + shadowDist, t + shadowDist, r + shadowDist, b + shadowDist, tocolor(att2, att3, att4, att5), self.fScale, self.strFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI ) end dxDrawColorText ( self.strText, l, t, r, b, tocolor(unpack(self.tColor)), self.fScale, self.strFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI ) break end end end ) + function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY) 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)), 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)), 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 the you can use dxText:create with color code
-
not bad
-
пфф фейкер ты же в реале не сможешь взять и дать кому до денег на руки, например в другой район
-
venom - -ffs-Venom?
-
use standart code function startMusic() setRadioChannel(0) song = playSound("song.mp3",true) outputChatBox("Toggle the music on/off with 'm'") end function makeRadioStayOff() setRadioChannel(0) cancelEvent() end function toggleSong() if not songOff then setSoundVolume(song,0) songOff = true removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) else setSoundVolume(song,1) songOff = false setRadioChannel(0) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) end end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff) addCommandHandler("music",toggleSong) bindKey("m","down","music")
-
show your connection.lua code
-
as i know race ORIGINAL "Countdown" system not support the image links or you not put it in meta
-
maybe you write errors here?
-
function blockChatMessage() cancelEvent() outputChatBox ('Main chat is locked',source,255,255,255,true) end addEventHandler( "onPlayerChat", getRootElement(), blockChatMessage ) в смысле?
-
велком ;D
-
wiki will help you no one not will make it for you
-
awesome map M3