-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
-- client side: Window = guiCreateWindow(9,4,432,251,"",false) guiWindowSetSizable (Window, false) guiSetVisible(Window,false) --img = guiCreateStaticImage(0,4,432,251,"back.png",false,Window) --guiMoveToBack( img ) --guiSetEnabled ( img, false ) tabPanel = guiCreateTabPanel(9,24,414,218,false,Window) tab1 = guiCreateTab("Name",tabPanel) labelColor = guiCreateLabel(175,30,110,17,"" ..getPlayerName(getLocalPlayer()) .. "", false, tab1) guiLabelSetColor(labelColor,255,255,255) redLabel = guiCreateLabel(0.1,0.2,0.2,0.1,"RED:",true,tab1) guiLabelSetColor(redLabel ,255 ,0 ,0 ) greenLabel = guiCreateLabel(0.1,0.4,0.2,0.1,"GREEN:",true,tab1) guiLabelSetColor(greenLabel ,0 ,255 ,0 ) blueLabel = guiCreateLabel(0.1,0.6,0.2,0.1,"BLUE:",true,tab1) guiLabelSetColor(blueLabel ,0 ,0 ,255 ) redBar = guiCreateScrollBar( 0.3, 0.2, 0.65, 0.1, true, true, tab1) greenBar = guiCreateScrollBar( 0.3, 0.4, 0.65, 0.1, true, true, tab1) blueBar = guiCreateScrollBar( 0.3, 0.6, 0.65, 0.1, true, true, tab1) tab2 = guiCreateTab("Light",tabPanel) labelColor2 = guiCreateLabel(175,30,110,17,"", false, tab2) redLabel = guiCreateLabel(0.1,0.2,0.2,0.1,"RED:",true,tab2) guiLabelSetColor(redLabel ,255 ,0 ,0 ) greenLabel = guiCreateLabel(0.1,0.4,0.2,0.1,"GREEN:",true,tab2) guiLabelSetColor(greenLabel ,0 ,255 ,0 ) blueLabel = guiCreateLabel(0.1,0.6,0.2,0.1,"BLUE:",true,tab2) guiLabelSetColor(blueLabel ,0 ,0 ,255 ) redBar2 = guiCreateScrollBar( 0.3, 0.2, 0.65, 0.1, true, true, tab2) greenBar2 = guiCreateScrollBar( 0.3, 0.4, 0.65, 0.1, true, true, tab2) blueBar2 = guiCreateScrollBar( 0.3, 0.6, 0.65, 0.1, true, true, tab2) -------------------------------------------------------------- --[[************ |Light Color|***********]]-- -------------------------------------------------------------- function lightColor() if source == redBar2 or source == greenBar2 or source == blueBar2 then local car = getPedOccupiedVehicle(getLocalPlayer()) setVehicleHeadLightColor(car,(guiScrollBarGetScrollPosition(redBar2)*2.55),(guiScrollBarGetScrollPosition(greenBar2)*2.55),(guiScrollBarGetScrollPosition(blueBar2)*2.55)) end end addEventHandler("onClientGUIScroll",getRootElement(),lightColor) function carColor() if source == redBar2 or source == greenBar2 or source == blueBar2 then guiLabelSetColor(labelColor2,(guiScrollBarGetScrollPosition(redBar2)*2.55),(guiScrollBarGetScrollPosition(greenBar2)*2.55),(guiScrollBarGetScrollPosition(blueBar2)*2.55)) end end addEventHandler("onClientGUIScroll",getRootElement(),carColor) ----------------------------------------------------------------- --[[************ |name Color|***********]]-- ------------------------------------------------------------------- function nameColor() if (source == redBar or source == greenBar or source == blueBar) then local red, green, blue = (guiScrollBarGetScrollPosition(redBar)*2.55),(guiScrollBarGetScrollPosition(greenBar)*2.55),(guiScrollBarGetScrollPosition(blueBar)*2.55) triggerServerEvent("nameTagColorChange",localPlayer,red,green,blue) guiLabelSetColor(labelColor,red,green,blue) end end addEventHandler("onClientGUIScroll",getRootElement(),nameColor) -------------------------------------------------------------------------- --[[************ |Timer|***********]]-- ------------------------------------------------------------------------------ addEventHandler ( "onClientPlayerChangeNick", getLocalPlayer(), function ( oldNick, newNick ) setTimer ( guiSetText, 60, 1, labelColor, newNick ) end ) function carname() local vehicle = getPedOccupiedVehicle(player) if vehicle then local carname = getVehicleName(vehicle) setTimer ( guiSetText, 60, 1, labelColor2, carname ) end end setTimer(carname,60,0) addEventHandler("onClientPlayerVehicleEnter", getRootElement(), carname) function ToggleMenu() if (guiGetVisible(Window) == true) then guiSetVisible(Window, false) showCursor(false) else guiSetVisible(Window, true) showCursor(true) --local sound = playSound("Pop.mp3") --setSoundVolume(sound, 2.5) end end bindKey("F5","down",ToggleMenu) -- server side: function nameTagColor ( redBar, greenBar, blueBar ) setPlayerNametagColor ( source, redBar,greenBar,blueBar ) end addEvent( "nameTagColorChange", true ) addEventHandler ( "nameTagColorChange", getRootElement(), nameTagColor)
-
Well, a timer doesn't kill anyone, does it? I use it to let the game load them first.
-
Copy my last code again, I added to check if it's higher than 25 but lower to 35.
-
exports["scoreboard"]:addScoreboardColumn ("Job", 3, nil, 0.07 )
-
Ok, I've found your problem, you are checking if the kills are 25 or HIGHER, and then again checking if 35 or HIGHER, but 25 is first, so it'll always set the team to "Subway clan". function checkKills(player) if (player and getElementType(player) == "player") then local kills = tonumber(getElementData(player,"Zombie kills")) if (not kills) then setElementData(player, "Zombie kills", 0) kills = 0 end if (kills <= 24) then setPlayerTeam(player, getTeamFromName("Beginners")) elseif (kills >= 25 and kills <= 35) then setPlayerTeam(player, getTeamFromName("Subway Clan")) elseif (kills >= 35) then setPlayerTeam(player, getTeamFromName("Clan 3")) end end end function setTeamZombie(killer) checkKills(killer) end addEvent("onZombieWasted",true) addEventHandler("onZombieWasted", root, setTeamZombie) addEventHandler("onPlayerLogin",root, function () checkKills(source) end)
-
This is total mess... function turn (thePlayer) local vehicle = getPedOccupiedVehicle(thePlayer) if (not vehicle) then return end local speedx, speedy, speedz = getElementVelocity ( vehicle ) local rX, rY, rZ = getElementRotation( vehicle ) local actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) local kmh = actualspeed * 180 local mph = actualspeed * 111.847 setElementRotation(vehicle,rX,rY,rZ+180) outputChatBox ( "You turned your Vehicle With ".. tostring(kph) .." km/h Or ".. tostring(mph) .." mph", thePlayer) end function bindTheKey() for index, player in pairs(getElementsByType("player")) do bindKey(player, "lctrl", "down", turn ) outputChatBox( "#00FF00You can now press #0000FFLCtrl in vehicle to turn for 180 degrees!", player ) end end addEventHandler( "onResourceStart", resourceRoot, bindTheKey) addEventHandler("onPlayerJoin",root, function () bindKey(source, "lctrl", "down", turn ) end)
-
Do you have all these teams created? the name's must be the same.
-
You can't, for this you must use element data, when click "Copy" use: setElementData(localPlayer,"text",guiGetText(GUIEditor_Memo[1])) When you click "Paste" do: local text = getElementData(localPlayer,"text") if (text and text ~= "") then guiSetText(data, tostring(text)) end
-
function checkKills(player) if (player and getElementType(player) == "player") then local kills = tonumber(getElementData(player,"Zombie kills")) if (not kills) then setElementData(player, "Zombie kills", 0) end if kills <= 24 then local beg = getTeamFromName("Beginners") setPlayerTeam(player,beg) elseif kills >= 25 then local sw1 = getTeamFromName("Subway Clan") setPlayerTeam(player, sw1) elseif kills >= 35 then local sw2 = getTeamFromName("Clan 3") setPlayerTeam(player, sw2) end end end function setTeamZombie(killer) checkKills(killer) end addEvent("onZombieWasted",true) addEventHandler("onZombieWasted", root, setTeamZombie) addEventHandler("onPlayerLogin",root, function () checkKills(source) end)
-
If you haven't noticed the script uses a trigger to create the mine: triggerServerEvent ( "onCreateMine", getRootElement(), x, y, z ) You just have to create a map file with X, Y, Z as data and then a simple function to load them all and create the mines.
-
Why should we give you the script done? can't you check these FPS in the MTA community and try to make it yourself?
-
My AFK script: https://community.multitheftauto.com/index.php?p= ... ls&id=3271
-
FPS = Frames Per Second. P.S: You can edit these resources maybe, and get a better attitude if you want to be helped.
-
setPedStat has three arguments: thePed, theStat, theValue. As listed in the wiki, there are some stats that doesn't make any effect at all.
-
If you want to create mines automatically, then I suggest you to use map files for it, is really easy to manage them after that.
-
Look what I've found in just 5 seconds in the MTA community: https://community.multitheftauto.com/index.php?p= ... tails&id=7 https://community.multitheftauto.com/index.php?p= ... ils&id=585 https://community.multitheftauto.com/index.php?p= ... ils&id=450
-
You mean already planted "mines"?
-
I don't understand what do you mean, could you explain yourself better?
-
I don't know what is your problem, it works perfectly fine here.
-
In your case, the "..." works as a table of arguments later used in table.find function. Example of using "..." as argument: addCommandHandler("text", function( player, command, ... ) local text = table.concat({...}, " ") -- This way the player can type texts with [b][u]spaces[/u][/b]. outputChatBox(tostring(text)) end)
-
local soundsTable = { "sound1.mp3", "sound2.mp3", } function Music() local soundPath = soundsTable[math.random(#soundsTable)] sound = playSound3D("sound/"..tostring(soundPath), 568.89764, -1857.21130, 4.7015, true) setSoundMaxDistance(sound, 30) end addEventHandler("onClientResourceStart", resourceRoot, Music) Try that, I don't know if it'll make any difference.
-
Is "Zombie kills" a number?
-
Where are you running this script from? if is not from the race himself, then findMap function will be missing.
