-
Posts
120 -
Joined
-
Last visited
Everything posted by JuniorMelo
-
well? local Col1[1] = executeSQLSelect ( "VColors", "Col1","serial = '" .. serial .. "'") local Col2[1] = executeSQLSelect ( "VColors", "Col2","serial = '" .. serial .. "'") local Col3[1] = executeSQLSelect ( "VColors", "Col3","serial = '" .. serial .. "'")
-
changed the error may be in client file ?? addEventHandler ( "onClientGUIClick", root, function ( VehColor,r, g, b,PVeh) if ( guiGetText ( r2 ) ~= "" ) and ( guiGetText ( g2 ) ~= "" ) and ( guiGetText ( b2 ) ~= "" ) then if ( source == ExecuteColor ) then local PVeh = getPedOccupiedVehicle(getLocalPlayer()) triggerServerEvent ( "GetColor2", localPlayer, guiGetText ( r2 ), guiGetText ( g2 ), guiGetText ( b2 ), PVeh ) elseif ( source == colorPicker ) then openPicker ( 59553532, "#000000", "Cor do Veiculo" ) end end end ) SERVER function ResourceStart() executeSQLCreateTable("VColors", "serial STRING,Col1 INT,Col2 INT,Col3 INT") end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), ResourceStart) addEvent ( "GetColor2", true ) addEventHandler ( "GetColor2", root, function ( r, g, b, PVeh ) triggerClientEvent ( root, "GetColor", root, r, g, b ) local serial = getPlayerSerial(source) setVehicleColor ( PVeh, r, g, b) outputChatBox("Settings Updated!",source,0,255,0) executeSQLUpdate ( "VColors", "Col1 = '"..r.."'","serial = '" .. serial .. "'") executeSQLUpdate ( "VColors", "Col2 = '"..g.."'","serial = '" .. serial .. "'") executeSQLUpdate ( "VColors", "Col3 = '"..b.."'","serial = '" .. serial .. "'") end ) function vehColor2() local players = getElementsByType ( "player" ) for k,v in ipairs(players) do local PVeh = getPedOccupiedVehicle(v) local serial = getPlayerSerial(v) local Col1 = executeSQLSelect ( "VColors", "Col1","serial = '" .. serial .. "'") local Col2 = executeSQLSelect ( "VColors", "Col2","serial = '" .. serial .. "'") local Col3 = executeSQLSelect ( "VColors", "Col3","serial = '" .. serial .. "'") setVehicleColor(PVeh,tonumber(Col1[1]["Col1"]),tonumber(Col2[1]["Col2"]),tonumber(Col3[1]["Col3"]) ) end end function timer() setTimer(vehColor2,3000,1) end function timer2() setTimer(vehColor2,tonumber(respawntime)+1000,1) end addEventHandler("onMapStarting",getRootElement(),timer)
-
Hello, I have a problem in this script has an error function ResourceStart() executeSQLCreateTable("VColors", "serial STRING,Col1 INT,Col2 INT,Col3 INT") end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), ResourceStart) addEvent ( "GetColor2", true ) addEventHandler ( "GetColor2", root, function ( r, g, b, PVeh ) triggerClientEvent ( root, "GetColor", root, r, g, b ) local serial = getPlayerSerial(source) setVehicleColor ( PVeh, r, g, b) outputChatBox("Settings Updated!",source,0,255,0) executeSQLUpdate ( "VColors", "Col1 = '"..r.."'","serial = '" .. serial .. "'") executeSQLUpdate ( "VColors", "Col2 = '"..g.."'","serial = '" .. serial .. "'") executeSQLUpdate ( "VColors", "Col3 = '"..b.."'","serial = '" .. serial .. "'") end ) function vehColor2() local players = getElementsByType ( "player" ) for k,v in ipairs(players) do local PVeh = getPedOccupiedVehicle(v) local serial = getPlayerSerial(v) local Col1 = executeSQLSelect ( "VColors", "Col1","serial = '" .. serial .. "'") local Col2 = executeSQLSelect ( "VColors", "Col2","serial = '" .. serial .. "'") local Col3 = executeSQLSelect ( "VColors", "Col3","serial = '" .. serial .. "'") setVehicleColor(PVeh,tonumber(Col1[1]["Col1"]),tonumber(Col2[1]["Col2"]),tonumber(Col3[1]["Col3"]) ) end end function timer() setTimer(vehColor2,3000,1) end function timer2() setTimer(vehColor2,tonumber(respawntime)+1000,1) end addEventHandler("onMapStarting",getRootElement(),timer) line 373: setVehicleColor(PVeh,tonumber(Col1[1]["Col1"]),tonumber(Col2[1]["Col2"]),tonumber(Col3[1]["Col3"]) )
-
you could answer me, because when the map changes the screen goes black for other teams ? I'm trying to get to change the map only team HUNTER ! sorry my bad english
-
I am wanting to put this function, to activate only for the team hunter function changeGamemodeMap_cmd(source, command, ...) local team = getPlayerTeam ( source ); if ( team == getTeamFromName ( "HUNTER" ) ) then local mapName = #{...}>0 and table.concat({...},' ') or nil source = source or serverConsole local map if mapName then map = getMapFromName(mapName) if not isMap(map) then if (refreshResources and hasObjectPermissionTo(getThisResource(), "function.refreshResources", false)) then outputMapManager("'"..mapName.."' is not a valid map.", source) else outputMapManager("'"..mapName.."' is not a valid map. Use the refresh command and try again", source) end return false end else outputMapManager("Usage: /"..command.." map",source) return false end local gamemode = currentGamemode if not isGamemode(gamemode) then outputMapManager("No gamemode is running.",source) elseif not isMapCompatibleWithGamemode(map, gamemode) then outputMapManager("Map '"..getResourceName(map).. "' is not compatible with '"..getResourceName(gamemode).."'.",source) else setInstigator( source ) changeGamemodeMap(map, gamemode) end end end No Work, the screen goes black for another team
-
I have a problem with the script mapmanager I'm trying for change put the map just for hunter team,but am not getting can help me =-= I am using this line in mapmanager team = getPlayerTeam ( player ) Name = getTeamFromName ( "HUNTER" ) if ( team ) == Name then
-
Uso de guiGetScreenSize para ajustar elementos da tela
JuniorMelo replied to DNL291's topic in Tutoriais em geral
Muito bom cara ... esse guiGetScreenSize já vem me dando trabalho por muito tempo AGORA SEI COMO FUNCIONA !! Vlw -
Thanks to all resolved function processPlayerSpawn(source) player = player or source if not isElement(player) then return end toggleControl ( player, "enter_exit", false ) triggerClientEvent (player,"stophud",getRootElement()) local posX,posY,posZ,rx,ry,rz local flagElements = getElementsByType ( "spawnpoint", mapRoot) -- loop through them for key, value in pairs(flagElements) do -- get our info local posX = getElementData ( value, "posX" ) local posY = getElementData ( value, "posY" ) local posZ = getElementData ( value, "posZ" ) rx = getElementData(value, "rotX") ry = getElementData(value, "rotY") rz = getElementData(value, "rotZ") if (isElement(Hunters[player])) then destroyElement(Hunters[player]) end spawnPlayer ( player, posX, posY, posZ, rz ) Hunters[player] = createVehicle( 425, posX, posY, posZ ) setElementDimension ( Hunters[player], 4 ) warpPedIntoVehicle(player, Hunters[player]) setElementPosition(Hunters[player], posX, posY, posZ ) setElementHealth(Hunters[player], 1000) end fadeCamera(player,true) setCameraTarget(player,player) end
-
no have erros in debugscript 3 you want me to use this function ?
-
hello,I have a problem When the player dies not reborn WARNING: local function spawnAllPlayers() processPlayerSpawn ( player ) end function processSpawnStart(delay) setTimer ( spawnAllPlayers, delay, 1 ) end function processPlayerSpawn (player) local posX,posY,posZ,rx,ry,rz local flagElements = getElementsByType ( "spawnpoint", mapRoot) for key, value in pairs(flagElements) do local posX = getElementData ( value, "posX" ) local posY = getElementData ( value, "posY" ) local posZ = getElementData ( value, "posZ" ) rx = getElementData(value, "rotX") ry = getElementData(value, "rotY") rz = getElementData(value, "rotZ") if (isElement(Hunters[player])) then destroyElement(Hunters[player]) end spawnPlayer ( player, posX, posY, posZ, rz, 4 ) Hunters[player] = createVehicle( 425, posX, posY, posZ ) setElementDimension ( Hunters[player], 4 ) warpPedIntoVehicle(player, Hunters[player]) setElementPosition(Hunters[player], posX, posY, posZ ) setElementHealth(Hunters[player], 1000) end fadeCamera(player,true) setCameraTarget(player,player) end function processWastedHunter() setTimer(processSpawnStart, 2000, 1, source) end addEventHandler ( "onPlayerWasted", getRootElement(), processWastedHunter )
-
is possible to change the map without the screen goes black ??
-
Test GUIEditor = { gridlist = {}, window = {}, button = {} } local vehs = {"BMX", "Coach", "Patriot", "QuadBike", "Maverick", "Stuntplane", "Rancher", "Comet", "Barracks"} GUIEditor.window[1] = guiCreateWindow(1135, 180, 231, 588, "", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(17, 19, 204, 390, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Free Vehicles", 0.9) for i, v in ipairs (vehs) do row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1], row, 1, tostring(v), false, false) end GUIEditor.button[1] = guiCreateButton(23, 419, 199, 68, "Select", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(25, 491, 197, 68, "Cancel", false, GUIEditor.window[1]) addEventHandler("onClientGUIClick", root, function() if (source == GUIEditor.button[2]) then guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end ) addEvent("openGUI", true) addEventHandler("openGUI", root, function() guiSetVisible(GUIEditor.window[1], true) showCursor(true) end ) addEventHandler("onClientGUIClick", root, function () if (source == GUIEditor.button[1]) then local vehicleName = guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), 1) local id = getVehicleModelFromName(vehicleName) triggerServerEvent("spawnVehicle", localPlayer, id) guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end ) function showPanel(thePlayer) triggerClientEvent(thePlayer, "openGUI", root) end function onResourceStart() for index, players in ipairs(getElementsByType("player")) do bindKey(players, "F4", "down", showPanel) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResourceStart) function onPlayerJoin() bindKey(source, "F4", "down", showPanel) end addEventHandler("onPlayerLogin", getRootElement(), onPlayerJoin) vehicles = {} addEvent("spawnVehicle", true ) addEventHandler("spawnVehicle", root, function ( vehID ) if ( isElement ( vehicles [ source ] ) ) then destroyElement ( vehicles [ source ] ) end vehicles [ source ] = createVehicle ( vehID, getElementPosition ( source ) ) if ( vehicles [ source ] ) then setVehicleColor ( vehicles [ source ], 255, 255, 255 ) end setTimer ( warpPedIntoVehicle, 200, 1, source, vehicles [ source ] ) end ) function destroyVehicle() if ( isElement ( vehicles [ source ] ) ) then destroyElement ( vehicles [ source ] ) end end addEventHandler("onPlayerLogout", root, destroyVehicle) addEventHandler("onPlayerQuit", root, destroyVehicle) addEventHandler("onPlayerWasted", root, destroyVehicle)
-
outputChatBox ( '#ff4444[GANG] #ffffff' .. RGBToHex(iR, iG, iB) .. '' .. getTeamName(pTeam) .. ' #ff4444Esta atacando o territorio#ffffff ' .. territorio .. ' #ff4444Da gang #ffffff' .. RGBToHex(rR,gG,bB) .. '' .. equipe , getRootElement(), 255, 255, 255,true )
-
Thanks castillo, helped a lot !!!
-
Hello I have a bug in a script, I can not put color team name local pTeam = getPlayerTeam( hitElement ) local iR, iG, iB = getTeamColor( pTeam ) outputChatBox ( '#ff4444[GANG] #ffffff' .. getTeamName( getTeamColor( pTeam ) ) .. ' #ff4444Esta atacando o territorio#ffffff ' .. Territorio .. ' #ff4444Da gang #ffffff' .. equipe , getRootElement(), 255, 255, 255,true ) line 55 outputChatBox ( '#ff4444[GANG] #ffffff' .. getTeamName( getTeamColor( pTeam ) ) .. ' #ff4444Esta atacando o territorio#ffffff ' .. Territorio .. ' #ff4444Da gang #ffffff' .. equipe , getRootElement(), 255, 255, 255,true )
-
Very good !! Good Luck !
-
Type vehicle = createVehicle( 433, 2870.1000976563, 963.20001220703, 11.300000190735, 0, 0, 136 ) state = setVehicleDoorState ( vehicle, 1, 1 ) addEventHandler("onVehicleStartEnter", vehicle, function(player) if getPlayerTeam(player) ~= getTeamFromName("MI-6") then cancelEvent() end end)
-
test vehicle = createVehicle( 433, 2870.1000976563, 963.20001220703, 11.300000190735, 0, 0, 136 ) state = setVehicleDoorState ( vehicle, 1, 1 ) addEventHandler("onVehicleStartEnter", root, function(player) if getPlayerTeam(player) ~= getTeamFromName("MI-6") then cancelEvent() end end)
-
tested operates normally, Thank you all for your help! Client addEventHandler("onClientPlayerWasted", getRootElement(), function () localPlayer = getLocalPlayer() triggerServerEvent("Collision", getRootElement(), localPlayer) end ) server addEvent("Collision", true) addEventHandler("Collision", getRootElement(), function (hitElement) if ( isElement ( hitElement ) and getElementType ( hitElement ) == "player" ) then local car = getPedOccupiedVehicle(hitElement) if car then local accountSource = getPlayerAccount ( hitElement ) setAccountData( accountSource,"totalkillsdeaths.Deaths",tonumber( getAccountData(accountSource,"totalkillsdeaths.Deaths") or 0 ) +1 ) setElementData( hitElement, "T/D", tonumber( getAccountData( accountSource,"totalkillsdeaths.Deaths" ) )) end end end ) addEventHandler( "onResourceStart",resourceRoot, function( ) outputDebugString( "add Total Deaths to scoreboard Return: "..tostring( call( getResourceFromName("Scoreboard"), "addScoreboardColumn", "T/D",root,3, 0.052 ) ) ) end )
-
this ? newmarker1 = createMarker ( 0, 0, 5, "checkpoint", 9.9, 0, 255, 0, 255 ) -- Create a green marker function markerfix(hitElement) if ( source == newmarker1 ) then if ( isElement ( hitElement ) and getElementType ( hitElement ) == "player" ) then local ve = getPedOccupiedVehicle(hitElement) fixVehicle(ve) takePlayerMoney ( hitElement, 200 ) end end end addEventHandler("onMarkerHit", getResourceRootElement(getThisResource()), markerfix)
