-
Posts
69 -
Joined
-
Last visited
Everything posted by Jacob Lenn
-
I'm not sure why in every 30 seconds u destroy blip.
-
I made this local blip = { } addEventHandler ( "onPlayerSpawn", root, function ( ) if ( not isElement ( blip [ source ] ) ) then blip [ source ] = createBlipAttachedTo ( source ) end local theTeam = getPlayerTeam ( source ) if ( not theTeam ) then return end local r, g, b = getTeamColor ( theTeam ) setPlayerNametagColor ( source, r, g, b ) setBlipColor ( blip [ source ], r, g, b, 255 ) end ) addEventHandler ( "onResourceStart", resourceRoot, function () for k, v in ipairs ( getElementsByType("player") ) do if ( not isElement ( blip [ v ] ) ) then blip [ v ] = createBlipAttachedTo ( v ) end local theTeam = getPlayerTeam ( v ) if (not theTeam) then return end local r, g, b = getTeamColor ( theTeam ) setPlayerNametagColor ( v, r, g, b ) setBlipColor ( blip [ v ], r, g, b, 255 ) end ) addEventHandler ( "onPlayerQuit", root, function ( ) if isElement ( blip [ source ] ) then destroyElement ( blip [ source ] ) end end ) But it doesnt work for me.
-
Hello i wanna create blips with color like palyer's nametag color. And i wanna make police invisible. I made some codes but it didn't work anyway and i'm pretty sure that i'm making it in bad way.
-
I have this: function randomMarker () local markers = xmlLoadFile("zaladunki.xml") if markers then local childs = xmlNodeGetChildren(markers) for k,v in ipairs (childs) do -- what shud i put here? end end end
-
XML: <zaladunki> <marker x="-1707.185546875" y="12.604281425476" z="3.5546875" type="cylinder" size="3" r="255" g="255" b="255" a="170" /> <marker x="158.99987792969" y="-22.182670593262" z=" 1.578125" type="cylinder" size="3" r="255" g="255" b="255" a="170" /> </zaladunki> How can i get random marker from this?
-
Resolved. I found this: function sec2min(sSeconds) local nSeconds = tonumber(sSeconds) if nSeconds == 0 then --return nil; return "00:00"; else nHours = string.format("%02.f", math.floor(nSeconds/3600)); nMins = string.format("%02.f", math.floor(nSeconds/60 - (nHours*60))); nSecs = string.format("%02.f", math.floor(nSeconds - nHours*3600 - nMins *60)); return nMins..":"..nSecs end end
-
Hello. How can i replace dot (".") with ":"? String.gsub doesn't work to me. I converted sec to minutes and i have sth like 1.23 and i want 1:23. Hope u can help me.
-
Wow ur da best. U only missed 1 thing. Here local numSpaces = math.floor ((gridListColumnWidth-textWidth)/2)/spaceWidth); Correct local numSpaces = math.floor (((gridListColumnWidth-textWidth)/2)/spaceWidth);
-
Pokaż trigger.
-
K thanks. And now how can i do gridlist without moving this bar below? Image: http://snag.gy/MP6fq.jpg
-
<towary> <item name="Item 1" cash="100" score="0" /> <item name="Item 2" cash="100" score="0" /> </towary> That's my XML file and how i can download all of these items and put them in girdlist? I know about triggering but i don't really know how XML function works. If someone be nice and can tell me how it works i will be happy.
-
Thanks.
-
Hello guys. I'm not good at tables. That's why i have problem. I have sth like this: availible_cars = { 403, 413, 414, 433, 440, 455, 456, 459, 498, 499, 514, 515, 578, 609 } for k,v in ipairs (availible_cars) do if v == getElementModel(veh) then outputChatBox("true") else outputChatBox("false") end end Don't ask me if I definied veh couse i did it in my normal code. But problem is in "else" of the "if". When car's model isn't in the table it is outputing about 14 times message "false". Is there a possibility to do this in another way without "for"? And is this code correct?
-
local screenWidth, screenHeight = guiGetScreenSize() local x = 0 addEventHandler("onClientRender", root, function () x = x + 0.01 local a , b = 50 , 100 local x, y = interpolateBetween ( a, b, 0, a+10, b+20, 0, x, "Linear") dxDrawImage( screenWidth - x, screenHeight - y , 63 , 62 ,"test.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) end) Try this.
-
local screenWidth, screenHeight = guiGetScreenSize() addEventHandler("onClientRender", root, function () local a , b = 50 , 100 local x, y = interpolateBetween ( a, b, 0, a+10, b+20, 0, progress, "Linear") dxDrawImage(screenWidth - 90,50 , a , b,"test.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) end) You must also set value of this "progress". Check wiki, they have example about this.
-
You can do more by using db functions: dbConnect dbQuery dbExec dbPoll dbFree
-
please help me with setElementVisibleTo please
Jacob Lenn replied to dazzlepoint's topic in Scripting
addEventHandler("onMarkerHit",createMarker(2121, 1402,10,"cylinder",2,0,255,0), function ( player ) if getElementType ( player ) == "player" then local bus = createVehicle ( 431, 2107, 1395, 10 ) warpPedIntoVehicle ( player, bus ) outputChatBox ( "you can earn money by driving to the markers" ) for k,v in ipairs (getElementsByType("player")) do if v == player then local myMarker = createMarker ( 2038.26, 1514.01, 9, "cylinder", 1.5, 255, 255, 0, 170, ) createBlip ( 2038.26, 1514.01, 13, 41, 0, 0, 0, 255, 0, 99999) end end --name = getPlayerName ( source ) end end,false) -
I don't understand you.
-
please help me with setElementVisibleTo please
Jacob Lenn replied to dazzlepoint's topic in Scripting
addEventHandler("onMarkerHit",createMarker(2121, 1402,10,"cylinder",2,0,255,0), function ( player ) if getElementType ( player ) == "player" then local bus = createVehicle ( 431, 2107, 1395, 10 ) warpPedIntoVehicle ( player, bus ) outputChatBox ( "you can earn money by driving to the markers" ) local myMarker = createMarker ( 2038.26, 1514.01, 9, "cylinder", 1.5, 255, 255, 0, 170, player ) createBlip ( 2038.26, 1514.01, 13, 41, 0, 0, 0, 255, 0, 99999, player) --name = getPlayerName ( source ) end end,false) -
Now you know why it is better to create scripts by yourself. You know where the problem can be.
-
onPlayerHealthChange event? (detect health change)
Jacob Lenn replied to johny46's topic in Scripting
onClientRender getElementHealth setElementData Isnt it better to use this functions? -
Send me this resource i will look how it works.
