-
Posts
708 -
Joined
-
Last visited
Everything posted by K4stic
-
it bugs all markers in server then i stop resource is all unbugged the markers and i have 5-6 scripts who used markers
-
i post and you say to add event "onResourceStart"
-
but if i do that then again adter more 5 spawns or 5 restart resource it bug me all markers in server so i need other way
-
It Create the markers from table 'vehicles' but then i hit the market not show the gui for index,table in pairs(vehicles) do local marker = createMarker(table.x, table.y, table.z, "cylinder", 2, table.r, table.g, table.b, 100) setElementData(marker, "vehiclemarker-role", table.Roles) setElementData(marker, "vehiclemarker-vehicles", table.vehicles) setElementData(marker, "vehiclemarker-rotation", table.rotation) vehicle[marker] = table.Roles local position = table.x..", "..table.y..", "..table.z..", "..table.rotation..", " local color1 = table.vehR1..", "..table.vehG1..", "..table.vehB1..", " local color2 = table.vehR2..", "..table.vehG2..", "..table.vehB2..", " setElementData(marker, "vehiclemarker-position", position) setElementData(marker, "vehiclemarker-color1", color1) setElementData(marker, "vehiclemarker-color2", color2) addEventHandler("onMarkerHit", marker, onPlayerVehicleMarkerHit) end function onPlayerVehicleMarkerHit(player) local role = getElementData(source, "vehiclemarker-role") local vehicles = getElementData(source, "vehiclemarker-vehicles") local rotation = getElementData(source, "vehiclemarker-rotation") if (not isElement(player)) then return end if (getElementType(player) ~= "player") then return end if (getElementData(player, dataToFindPlayersJob) == role or role == "ALL") then if (isPedInVehicle(player)) then return end local position = getElementData(source, "vehiclemarker-position") local color1 = getElementData(source, "vehiclemarker-color1") local color2 = getElementData(source, "vehiclemarker-color2") local posX, posY, posZ, rotation = unpack(split(position, ",")) local r, g, b = unpack(split(color1, ",")) local r2, g2, b2 = unpack(split(color2, ",")) triggerClientEvent(player, "jobvehicles.showVehicleGUI", root, vehicles, rotation, posX, posY, posZ, rotation, r, g, b, r2, g2, b2) else outputChatBox("This marker is reserved for '"..role.."'", player, 250, 0, 0) end end
-
Guys pls give me more info and explain for that 2 event's 1. "onClientPreRender" 2. "onClientRender"
-
and what you think is this? maxrange = 20
-
setTimer( function () for i,v in ipairs (getElementsByType("vehicle")) do if (tonumber(getElementData(v,"fuel")) <=1) and (getVehicleEngineState(v)==true) then setVehicleEngineState(v,false) elseif (tonumber(getElementData(v,"fuel")) >= 0) and (getVehicleEngineState(v)==false) then setVehicleEngineState(v,true) end end end, 1000, 0 ) try this
-
-- Disabled the seasparrow weapons for player not in staff or military forces team addEventHandler("onClientVehicleStartEnter", root, function(thePlayer, seat) if ( thePlayer == localPlayer ) then if ( getElementModel ( source ) == 447 ) or ( getElementModel ( source ) == 425 ) or ( getElementModel ( source ) == 520 ) then if (getTeamName(getPlayerTeam(thePlayer)) == "Staff") or (getTeamName(getPlayerTeam(thePlayer)) == "Armed Forces") then toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) else toggleControl ( "vehicle_fire", false ) toggleControl ( "vehicle_secondary_fire", false ) end end end end ) -- Enable the weapons again when the player leaves the vehicle addEventHandler("OnClientVehicleStartExit", root, function(thePlayer, seat) if thePlayer == localPlayer then if ( getElementModel ( source ) == 447 ) or ( getElementModel ( source ) == 425 ) or ( getElementModel ( source ) == 520 ) then if not (getTeamName(getPlayerTeam(thePlayer)) == "Staff") or not (getTeamName(getPlayerTeam(thePlayer)) == "Armed Forces") then toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) end end end end ) it no disable the weapon for other teams i wonna to player can shoot with that vehicles only if he Staff or Armed Forces but it no disable it
-
Guys help me pls this is example of convert Hex to RGB how i can make convert RGB to Hex? -- Hex to RGB function hex2rgb(hex) hex = hex:gsub("#","") return tonumber("0x"..hex:sub(1,2)), tonumber("0x"..hex:sub(3,4)), tonumber("0x"..hex:sub(5,6)) end
-
now all work perfect thanks i only must be add guiFPSLabel = nil
-
LOL IIYAMA but on 3rd type /myfps is not show me fps
-
add it to Admin group in acl.xml
-
ok now work but it's output me to debugscript that line 14:RemoveEventHandler(a nil value) local FPSLimit = 100 local FPSMax = 1 function onClientResourceStart ( resource ) if ( guiFPSLabel == nil ) then FPSLimit = 255 / FPSLimit guiFPSLabel = guiCreateLabel ( 0.03, 0.97, 0.1, 0.1, "FPS: 0", true ) FPSCalc = 0 FPSTime = getTickCount() + 1000 addEventHandler ( "onClientRender", root, onClientRender ) else guiSetText ( guiFPSLabel, "" ) destroyElement(guiFPSLabel) RemoveEventHandler ( "onClientRender", root, onClientRender ) end end addCommandHandler("myfps", onClientResourceStart) function onClientRender ( ) if ( getTickCount() < FPSTime ) then FPSCalc = FPSCalc + 1 else if ( FPSCalc > FPSMax ) then FPSLimit = 255 / FPSCalc FPSMax = FPSCalc end guiSetText ( guiFPSLabel, "FPS: "..FPSCalc.." Max: "..FPSMax ) guiLabelSetColor ( guiFPSLabel, 255 - math.ceil ( FPSCalc * FPSLimit ), math.ceil ( FPSCalc * FPSLimit ), 0 ) FPSCalc = 0 FPSTime = getTickCount() + 1000 end end
-
Problem then i type /myfps it show then i again type /myfps it's hide it but if i again type /myfps then is not show it me again No Error's in Debugscript local FPSLimit = 100 local FPSMax = 1 function onClientResourceStart ( resource ) if ( guiFPSLabel == nil ) then FPSLimit = 255 / FPSLimit guiFPSLabel = guiCreateLabel ( 0.03, 0.97, 0.1, 0.1, "FPS: 0", true ) FPSCalc = 0 FPSTime = getTickCount() + 1000 addEventHandler ( "onClientRender", root, onClientRender ) else guiSetText ( guiFPSLabel, nil ) end end addCommandHandler("myfps", onClientResourceStart) function onClientRender ( ) if ( getTickCount() < FPSTime ) then FPSCalc = FPSCalc + 1 else if ( FPSCalc > FPSMax ) then FPSLimit = 255 / FPSCalc FPSMax = FPSCalc end guiSetText ( guiFPSLabel, "FPS: "..FPSCalc.." Max: "..FPSMax ) guiLabelSetColor ( guiFPSLabel, 255 - math.ceil ( FPSCalc * FPSLimit ), math.ceil ( FPSCalc * FPSLimit ), 0 ) FPSCalc = 0 FPSTime = getTickCount() + 1000 end end
-
Guys help me pls how make if player addEventHandler("onClientVehicleEnter", root, if (seat == 0) and (sound) or (seat == 0) and (mysound) then end) to play music and to other's in car (the code not full that because i ask help)
-
search for what i don't know what add to search box to search it -.-'
-
can you help me more? because then i post first code it's refresh only userpanelGrid1 and no userpanelGrid2
-
so this is ok? function getgridlist() guiGridListClear( userPanelGrid1 ) guiGridListClear( userPanelGrid2 ) for key,player in pairs(getElementsByType("player")) do local row = guiGridListAddRow(userPanelGrid1) local row2 = guiGridListAddRow(userPanelGrid2) guiGridListSetItemText(userPanelGrid1, row, playerCol, getPlayerName(player), false, false) guiGridListSetItemText(userPanelGrid2, row2, playerCol2, getPlayerName(player), false, false) end end addEventHandler("onClientPlayerJoin", root, getgridlist) addEventHandler("onClientPlayerQuit", root, getgridlist) addEventHandler("onClientPlayerChangeNick", root, getgridlist)
-
Other problem now i can't click on player's names