-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
You're welcome.
-
You're welcome.
-
I don't see why it shouldn't work, that line checks if 'data' is a table.
-
local message = "" addEvent ( "onUpgradeText", true ) addEventHandler ( "onUpgradeText", root, function ( msg ) removeEventHandler ( "onClientRender", root, weaponBar ) message = msg addEventHandler ( "onClientRender", root, weaponBar ) end ) function weaponBar ( ) dxDrawRectangle (posX*2+300,posY,250,100, tocolor (0,0,0,150)) dxDrawRectangle (posX*2+300,posY,250,Hvis, tocolor (255,255,255,150)) dxDrawText ("Upgrade",posX*2+300,-(vis)+50-(Hvis),sX,sY,tocolor (255,255,255,255),1.5,"default-bold", "center", "center") dxDrawText (message,posX*2+300,-(vis)+100-(Hvis),sX,sY,tocolor (255,255,255,255),2,"default-bold", "center", "center") end I'm assuming that you have 'posX', 'posY', 'Hvis', 'vis' variables defined already?
-
Post both client and server side scripts.
-
local aTable = { } function test ( ) local obj = createObject ( ) -- Create an object. local col = createColTube ( ) -- Create a colshape. local blip = createBlipAttachedTo ( obj, 0 ) -- Create a blip attached to the object. attachElements ( col, obj ) -- Attach the colshape to the object. aTable [ col ] = { } -- Create a sub table inside 'aTable' using the colshape as index. aTable [ col ].object = obj -- Store the object element in this subtable. aTable [ col ].blip = blip -- Store the blip element in this subtable. addEventHandler ( "onClientColShapeHit", col, test2 ) end function test2 ( element ) if ( element == localPlayer ) then local data = aTable [ source ] if ( type ( data ) == "table" ) then destroyElement ( source ) destroyElement ( data.blip ) destroyElement ( data.object ) aTable [ source ] = nil end end end
-
Lemme get it right: you created an object, and you want to attach to this object a blip and a colshape, and when you hit this colshape, you want all the three things destroyed?
-
Why can't you do it?
-
Store everything in a table, then when you the colshape is hit, destroy them?
-
That'll trigger to everyone, not just to 'source'.
-
Race game mode removes the HEX color codes, instead of using getPlayerName, use _getPlayerName. dxDrawText ( _getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(0,0,0,255), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", true, true, true, true) dxDrawText ( _getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", true, true, true, true)
-
createBlipAttachedTo With that function, you can attach a blip directly to another element.
-
triggerClientEvent ( source, "onUpgradeText", source, message )
-
The problem is that you forgot to set the 'getPropagated' argument from addEventHandlet to 'false'. addEventHandler ( "onClientGUIClick", botonComprarPistola, darPistola ) change it to: addEventHandler ( "onClientGUIClick", botonComprarPistola, darPistola, false ) Do the same with your other 'onClientGUIClick' events.
-
addCommandHandler getPlayerAccount getAccountName aclGetGroup aclGroupRemoveObject
-
See how the current ones are made, and then do the same.
-
dxDrawText ( getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", true, true, true, true)
-
One thing is replacing textures ( TXD ) and another thing is replacing models ( DFF ), there are functions to replace textures and models.
-
function Funcion1 ( hitElement ) if ( getElementType ( hitElement ) == "player" ) then local accName = getAccountName ( getPlayerAccount ( hitElement ) ) if ( accName == "DelaHoz" ) then moveObject ( objeto1, 2000, -1186.099609375, -157.3994140625, 22, 0, 0, 0 ) outputChatBox ( "Bienvenido", hitElement, 0, 255, 0, true ) else outputChatBox ( "Tu no eres el Dueño!", hitElement, 255, 0, 0, true ) end end end addEventHandler ( "onColShapeHit", Zona1, Funcion1 ) function Funcion2 ( leaveElement ) if ( getElementType ( leaveElement ) == "player" ) then moveObject ( objeto1, 2000, -1186.099609375, -157.3994140625, 15.89999961853, 0, 0, 0 ) outputChatBox ( "Abandonando Base!".. Zona1, leaveElement, 0, 255, 0, true ) end end addEventHandler ( "onColShapeLeave", Zona1, Funcion2 )
-
dxDrawText(self.strText, 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, true ) 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(self.strText, 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, true ) end dxDrawText ( self.strText, l, t, r, b, tocolor(unpack(self.tColor)), self.fScale, self.strFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI, true ) Try it.
-
Go to "race/textlib.lua" and search for dxDrawText, then you must enable the colorCoded argument of the function.