
Overkillz
Members-
Posts
545 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Overkillz
-
No problem, your welcome.
-
Im requesting here some functions names as I said at the beggining of the post.
-
Try this local current = 1 function testBinds() if current == 1 then setPedWeaponSlot ( localPlayer, 2 ) current = 2 elseif current == 2 then setPedWeaponSlot ( localPlayer, 3 ) current = 1 end end bindKey("1", "down", testBinds)
-
I thinnk I got you, and as I saw on your comments, you are taking bad the variable getTime() Try this: setTimer(function() local hours, minutes = getTime() if hours >= 1 and hours <= 5 then setFarClipDistance( 70 ) setFogDistance ( 30 ) setSkyGradient(0,0,0,0,0,0) setWeather ( 22 ) setCloudsEnabled ( false ) setSunSize ( 0 ) elseif hours > 5 and hours <= 7 then setFarClipDistance( 120 ) setFogDistance ( 70 ) setSkyGradient( 0, 14, 12, 14, 13.5, 10 ) setWeather ( 3 ) setCloudsEnabled ( false ) setSunSize ( 2 ) elseif hours > 7 and hours <= 11 then setFarClipDistance( 220 ) setFogDistance ( 170 ) setSkyGradient( 0, 89, 196, 136, 170, 180 ) setWeather ( 4 ) setCloudsEnabled ( true ) setSunSize ( 2 ) elseif hours == 20 then setFarClipDistance( 180 ) setFogDistance ( 100 ) setSkyGradient( 25, 25, 25, 25, 25, 25 ) setWeather ( 8 ) setRainLevel ( 1.8 ) setWindVelocity ( 0.3, 0.1, 0 ) setCloudsEnabled ( true ) setSunSize ( 2 ) else setFarClipDistance( 240 ) setFogDistance ( 150 ) resetSkyGradient() setWeather ( 4 ) setCloudsEnabled ( true ) setWindVelocity ( 0, 0, 0 ) setSunSize ( 3 ) end setWaveHeight ( 0 ) end,1000,0)
-
Not really. might are u getting the same doubt that I got some months ago. I tried to do a welcome message depending of the time of the player. I was using it as server side, then I didnt know why the players were getting other time, till I read that using getRealTime() as client side you will get the time of the player. I really cant understand your point yet. Sorry.
-
getRealTime is a shared function. Using it as serverside it will give you the current time IN THE SERVER. Regards.
-
I already know it, but it do some weard shits if I do it. I just wanted to try it what it could be the result. However, I dont think so that adding a ped will work.
-
It should work now setTimer(function() local time = getRealTime() local hours = time.hour if hours >= 1 and hours <= 5 then setFarClipDistance( 70 ) setFogDistance ( 30 ) setSkyGradient(0,0,0,0,0,0) setWeather ( 22 ) setCloudsEnabled ( false ) setSunSize ( 0 ) elseif hours > 5 and hours <= 7 then setFarClipDistance( 120 ) setFogDistance ( 70 ) setSkyGradient( 0, 14, 12, 14, 13.5, 10 ) setWeather ( 3 ) setCloudsEnabled ( false ) setSunSize ( 2 ) elseif hours > 7 and hours <= 11 then setFarClipDistance( 220 ) setFogDistance ( 170 ) setSkyGradient( 0, 89, 196, 136, 170, 180 ) setWeather ( 4 ) setCloudsEnabled ( true ) setSunSize ( 2 ) elseif hours == 20 then setFarClipDistance( 180 ) setFogDistance ( 100 ) setSkyGradient( 25, 25, 25, 25, 25, 25 ) setWeather ( 8 ) setRainLevel ( 1.8 ) setWindVelocity ( 0.3, 0.1, 0 ) setCloudsEnabled ( true ) setSunSize ( 2 ) else setFarClipDistance( 240 ) setFogDistance ( 150 ) resetSkyGradient() setWeather ( 4 ) setCloudsEnabled ( true ) setWindVelocity ( 0, 0, 0 ) setSunSize ( 3 ) end setWaveHeight ( 0 ) end,1000,0) The problem was that you are not updating the real time. Now it should works ( Not tested )
-
But I wont follow the camera of other player, I want to follow the cam of my vehicle (Car variable) which is being moved automatically using some cordenates that I set. It moves perfectly, but I want a camera function to looks like If I would be driving it.
-
This should be enought for it local sX,sY = guiGetScreenSize() local counter = 15 local r,g,b = 0,255,0 function drawCounterSHI() dxDrawText("Your vehicle will change in: "..counter,0,sY*0.8,sX,sY,tocolor(r,g,b,255),2,"default","center","top",false,false,false) end addEventHandler("onClientRender",root,drawCounterSHI) setTimer(function() counter = counter - 1 if counter < 0 then counter = 15 r,g,b = 0,255,0 end if counter <= 3 then r,g,b = 255,0,0 end end,1000,0) Its not tested but it should works. NOTE: ITS CLIENT SIDE Regards.
-
function drawing() if sound then if (working) then local ls,rs = getSoundLevelData(sound); if (ls ~= false) then if moveOn == true then local meta = getSoundMetaTags(sound); local title = meta.title or "Unknown" local name = meta.stream_name or "Unknown" local longitud = dxGetTextWidth ( title, 1.25, myFont, true ) local longitud2 = dxGetTextWidth (" || Played by: "..name, 1.25, myFont, true ) --Marco dxDrawRectangle(x*1630, y*70, longitud+longitud2, y*30, tocolor(255, 136, 0, 255), false) --Soundwave dxDrawRectangle(x*1625, y*100, x*5, (x*(-30))*(ls/32768), tocolor(0, 0, 0, 255), true) if title then dxDrawText(title.." || Played by: "..name, x*1630, y*70, x*1630+(longitud+longitud2), y*70+(y*30), tocolor(0, 0, 0, 255), 1.25, myFont, "center", "center", true, true, true, true, true) else title = "Song can't be found sorry." end end end end end end addEventHandler("onClientRender", root, drawing)
-
Hey dear community, Im having a weard issue. Well, my point is that I want to create a vehicle moving by x cordenates to x cordenates. Well, that is ok, I did it, but I would like to set the camera like if I would be driving the car, I would like to move the camera with the mouse, as If i would be driving a simple car, but in this case the car is moving alone, I just need the camera function for it. I already tried setCameraTarget setCameraMatrix setCameraViewMode Well, I wont post all the code, just the part that I need. local handled = false car = createVehicle(411,0,0,0,0,0,0) function whatEver() -- Here is the code of the Vehicle moving automatically ------------------------------------------------------------ -- The following one is to call the camera if not handled then turnCamera() handled = true outputChatBox("Handled") end end function turnCamera() setCameraTarget(car) end Thanks for reading. Regards.
-
In my case, I run a race DM Server, When someone joins he has 2 downloads. Might this could sound weard but I will expalin it. The first one create the folders ...etc, I suposse that it loads server side scripts. When this is downloaded, the camera matrix should be started. Then the 2nd download started. Well, now are downloading the client files. I dont know if u get me, but it could help u. Regards.
-
If you say that it works when u restart the script, then you dont need to add the event onClientPlayerJoin. It is started by onClientRender, then u can avoid that. On the other hand, if you want to use an event when the player joins, I recommend you to use a trigger. Regards.
-
Hey there dear communitty, I have got some problems with a bug on my server, well, many guys have abused of this and the ranking is a bit fucked, well, everything is saved on the default MTA Data Base, my quesiton is the following one. Can I modify it while the server is running ? I would modify it with SQL Browser software. Thanks for reading. Regards.
-
I didnt get u, whats the goal of mark the alpha as nil.
-
Ye, I know it, but if I add more than one element, like this animB(800,500,270,40,255,255,255) animB(800,700,270,40,255,255,255) animB(300,700,270,40,255,255,255) The animation doesn't work.
-
Hey dear guys, Im having a problem building a Lib, well, my idea is to create a rectangle which when the mouse is over it, the alpha increase only to it. Well, its a system to create animate buttons local sX,sY = guiGetScreenSize() function animB(posX,posY,sizeX,sizeY,r,g,b) if isCursorHover(posX,posY,sizeX,sizeY) then aFinal = math.min(aFinal + 20, 255) dxDrawRectangle(posX,posY,sizeX,sizeY,tocolor(r,g,b,aFinal)) else aFinal = math.min(aFinal - 20, 0) dxDrawRectangle(posX,posY,sizeX,sizeY,tocolor(r,g,b,aFinal)) end end function isCursorHover(posX,posY,sizeX,sizeY) local x,y = 0,0 if isCursorShowing() then x,y = getCursorPosition() x,y = sX*x,sY*y else return false end if x>=posX and x<=posX+sizeX and y>=posY and y<=posY+sizeY then return true else return false end end -- ## LETS TEST IT function testingIt() animB(500,500,270,40,255,255,255) end addEventHandler("onClientRender",getRootElement(),testingIt) Well, the error that I get on Debugscript 3 is: attemt to perfom arithmetic on global 'aFinal' (a nil value) I hope u can tell me how can I define it Regards.
-
isGuestAccount -- Check if the player is logged getPlayerAccount -- Get the Player Account getAccountData --U can use this one to get the data, in case of no, u have to define it by the next function setAccountData -- Set the points/cash or whatever u want getElementData -- You can use it to draw as the following function (I use it to draw the values.) setElementData You can build you own system with these functions.
-
If i use the code that u exactly u gave me, I cant organize them setting for the first, 2nd and 3rd place a different dxLib and from 4 to 8 a different Lib. This is burning my mind, I still trying to fix this simple problem 3 days ago and I still with the same problem.
-
I think its me, Im not getting you, I will explain my situation slowly. Im getting that error when the player is dead -- Server Side killerTable = {} function updateKiller() local killer = getElementData(source,"lastHit") local Hits = getElementData(source,"hitsNumber") or 0 if killer then if ( not killerTable[killer] ) then killerTable[killer] = {playerName = getPlayerNametagText(killer), playerKills = 0, playerHits = 0} end killerTable[killer].playerKills = killerTable[killer].playerKills + 1 killerTable[killer].playerHits = Hits table.sort (killerTable, function (a, b) return a.playerKills > b.playerKills end) triggerClientEvent(getRootElement(), "sendClientToTable", resourceRoot, killerTable) end end addEventHandler( "onPlayerWasted", getRootElement(),updateKiller) --Client Receive Trigger function blabla(tableFromServerside) killerTable = tableFromServerside if killerTable then table.sort (killerTable, function (a, b) return a.playerKills < b.playerKills end) end outputChatBox("Table Triggered Correctly") end addEvent("sendClientToTable", true) addEventHandler("sendClientToTable", root, blabla) -- Draw Part for id, value in pairs(killerTable) do if tonumber(id) == tonumber(1) then dxLibTopwinners(ddKill.posT,(sY*0.038+34*scale),sizeXT,sizeYT,killerTable[id].playerName,1*font_size,fontTopKillers,255,255,255,ddKill.alphaT[1],0,0,0,ddKill.alphaT[2],sizeYT*0.8,sizeYT*0.8,255,136,0,ddKill.alphaT[1],"Kills: "..killerTable[id].playerKills or "?","Hits: ".."",false,false) end if tonumber(id) == tonumber(2) then dxLibTopwinners(ddKill.posT,(sY*0.038+34*scale)+sizeYT*1.05,sizeXT,sizeYT,killerTable[id].playerName,1*font_size,fontTopKillers,255,255,255,ddKill.alphaT[1],0,0,0,ddKill.alphaT[2],sizeYT*0.8,sizeYT*0.8,105,105,105,ddKill.alphaT[1],"Kills: "..killerTable[id].playerKills or "?","Hits: ".."",false,false) end if tonumber(id) == tonumber(3) then dxLibTopwinners(ddKill.posT,(sY*0.038+34*scale)+sizeYT*1.05*2,sizeXT,sizeYT,killerTable[id].playerName,1*font_size,fontTopKillers,255,255,255,ddKill.alphaT[1],0,0,0,ddKill.alphaT[2],sizeYT*0.8,sizeYT*0.8,139,54,38,ddKill.alphaT[1],"Kills: "..killerTable[id].playerKills or "?","Hits: ".."",false,false) end if tonumber(id) >= tonumber(4) and tonumber(id) <= tonumber(8) then dxLibToptime(ddKill.posT,(sY*0.038+34*scale)+sizeYT*1.05*(id-1),sizeXT,sizeYT,killerTable[id].playerName,1*font_size,fontTopKillers,255,255,255,ddKill.alphaT[1],0,0,0,ddKill.alphaT[2],sizeYT*0.8,sizeYT*0.8,45,60,81,ddKill.alphaT[1],id,"Kills: "..killerTable[id].playerKills or "?","Hits: ".."",1.2*font_size,false,false) end end I want to draw the Top Killers following the order of kills. Well, when I triggeer a manual table, it drops normally, but when the real player die, it doesnt to anything, it just drop me some errors having as errors id is nil ...etc Also, I tried to use ur both methods and it doesnt work. Thanks for Helping and regards..
-
Thanks a lot of dude, however, I have been doing my test triggering the table with the values to use it with my Lib --Server Trigger to client function addInto() for i=1,5 do if ( not killerTable["Name"..i] ) then killerTable["Name"..i] = {playerName = "Name "..i, playerKills = 0} end killerTable["Name"..i].playerKills = killerTable["Name"..i].playerKills + (math.random(1,8)) triggerClientEvent(getRootElement(), "sendClientToTable", resourceRoot, killerTable) outputChatBox("Added Correctly") end end addCommandHandler("add",addInto) -- Trigger Client Side function blabla(tableFromServerside) --killerTable = {} killerTable = tableFromServerside if killerTable then table.sort (killerTable, function (a, b) return a.playerKills > b.playerKills end) end outputChatBox("Table Triggered Correctly") end addEvent("sendClientToTable", true) addEventHandler("sendClientToTable", root, blabla) --Client Draw with my Lib for id, value in pairs(killerTable) do if tonumber(id) == tonumber(1) then dxLibTopwinners(ddKill.posT,(sY*0.038+34*scale),sizeXT,sizeYT,killerTable[id].playerName,1*font_size,fontTopKillers,255,255,255,ddKill.alphaT[1],0,0,0,ddKill.alphaT[2],sizeYT*0.8,sizeYT*0.8,255,136,0,ddKill.alphaT[1],"Kills: "..killerTable[id].playerKills or "?","Hits: ".."",false,false) end if tonumber(id) == tonumber(2) then dxLibTopwinners(ddKill.posT,(sY*0.038+34*scale)+sizeYT*1.05,sizeXT,sizeYT,killerTable[id].playerName,1*font_size,fontTopKillers,255,255,255,ddKill.alphaT[1],0,0,0,ddKill.alphaT[2],sizeYT*0.8,sizeYT*0.8,105,105,105,ddKill.alphaT[1],"Kills: "..killerTable[id].playerKills or "?","Hits: ".."",false,false) end if tonumber(id) == tonumber(3) then dxLibTopwinners(ddKill.posT,(sY*0.038+34*scale)+sizeYT*1.05*2,sizeXT,sizeYT,killerTable[id].playerName,1*font_size,fontTopKillers,255,255,255,ddKill.alphaT[1],0,0,0,ddKill.alphaT[2],sizeYT*0.8,sizeYT*0.8,139,54,38,ddKill.alphaT[1],"Kills: "..killerTable[id].playerKills or "?","Hits: ".."",false,false) end --The next line is the 146 if tonumber(id) >= tonumber(4) and tonumber(id) <= tonumber(8) then dxLibToptime(ddKill.posT,(sY*0.038+34*scale)+sizeYT*1.05*(id-1),sizeXT,sizeYT,killerTable[id].playerName,1*font_size,fontTopKillers,255,255,255,ddKill.alphaT[1],0,0,0,ddKill.alphaT[2],sizeYT*0.8,sizeYT*0.8,45,60,81,ddKill.alphaT[1],id,"Kills: "..killerTable[id].playerKills or "?","Hits: ".."",1.2*font_size,false,false) end end -- Variables are defined, but I got this error after triggering on the line 146 (I marked it on the script) - http://puu.sh/owTvk/5c5bec27ef.png (Image) I hope that u can help me to solve this problem, I have been more than 2 days working on this. Thanks
-
Thanks, however I did my own way for id, value in pairs(killerTable) do if id == 1 then dxDraw.... end if id >= 2 then dxDraw.... end end Thanks for helping. There is a way to check if a table is empty or to delete the table fully ?
-
Well, thats nice, if I want to add diferent colours or whatever I want for the first place, should I do this ? for _, value in pairs(killerTable) do for i=1,1 do dxDrawText(value.playerName.. " Kills: "..value.playerKills,sX/2,sY/2,0,0,tocolor(255,255,255,255),1,"default-bold","left","top",false,false,false,true) end for i=2,8 do dxDrawText(value.playerName.. " Kills: "..value.playerKills,sX/2,sY/2,0,0,tocolor(255,255,255,255),1,"default-bold","left","top",false,false,false,true) end end