Jump to content

Wei

Members
  • Posts

    814
  • Joined

  • Last visited

Everything posted by Wei

  1. Wei

    Help

    Have you set the duration did you do like /task 1 15
  2. Wei

    Scoreboard Flags

    If you still need: exports.scoreboard:addScoreboardColumn ( 'Home' ) function showcountry ( ) local flag = exports.admin:getPlayerCountry ( source ) or "US" setElementData ( source, "Home", flag) end addEventHandler ( "onPlayerJoin", root, showcountry ) addEventHandler ( "onPlayerChat", root, showcountry ) elseif column.name == "Home" then dxDrawImage( topX+theX, y+s(1), 16, 11, ":admin/client/images/flags/"..content..".png", 0, 0, 0, cWhite, drawOverGUI ) dxDrawText( string.upper(content), topX+theX+23, y, topX+x+s(column.width), y+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ), tocolor( r or 255, g or 255, b or 255, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) that should work
  3. Motor = guiCreateStaticImage(X,Y, Width, Height,"data/engine_on.png", false) guiSetVisible(Motor, false) function MotorOn() guiSetVisible(Motor, true) guiStaticImageLoadImage(Motor, "data/engine_on.png") end addEvent("OnMotor", true) addEventHandler("OnMotor", root, MotorOn) function MotorOff() guiSetVisible(Motor, true) guiStaticImageLoadImage(Motor, "data/engine_off.png") end addEvent("OffMotor", true) addEventHandler("OffMotor", root, MotorOff) function CloseMotor() guiSetVisible(Motor, false) end addEvent("CloseMotor", true) addEventHandler("CloseMotor", root, CloseMotor) Try that
  4. You can use mta-paradise by mabako But you should update it since its outdated... You can also use basic roleplay from socialz
  5. Edited post like 5 times local enginestate = {} function motor_func(player) local veh = getPedOccupiedVehicle(player) if veh then setVehicleEngineState(veh,not enginestate[veh]) enginestate[veh] = not enginestate[veh] if (enginestate[veh]) then triggerClientEvent("OnMotor", player) else triggerClientEvent("OffMotor", player) end end end function light_func(player) local veh = getPedOccupiedVehicle(player) if veh then if getVehicleOverrideLights(veh) ~= 2 then setVehicleOverrideLights(veh,2) else setVehicleOverrideLights(veh,1) end end end addEventHandler("onVehicleEnter",getRootElement(),function (player, seat) if seat == 0 then outputChatBox("Starte den Motor mit 'X' und die Lichter mit 'L'",player,0,125,0) enginestate[source] = false setVehicleEngineState(source, false) triggerClientEvent(player,"OffMotor", player) bindKey(player,"l","down",light_func, player) bindKey(player,"x","down",motor_func, player) end end) addEventHandler("onVehicleExit",getRootElement(),function (player, seat) if seat == 0 then unbindKey(player,"l","down",light_func) unbindKey(player,"x","down",motor_func) triggerClientEvent(player, "CloseMotor", player) end end) this should work as you want
  6. function triplo() setTimer ( triggerServerEvent, 15000, 1, "ClientHaveLevels", getLocalPlayer() ) end addCommandHandler("triplo", triplo) addEventHandler("onClientPlayerWasted", getLocalPlayer(), triplo)
  7. function motor_func() local veh = getPedOccupiedVehicle(source) if veh then setVehicleEngineState(veh,not getVehicleEngineState(veh)) setElementData(veh,"engine", getVehicleEngineState(veh)) end end Try this, but your code is a mess if not enginestate then setElementData(source,"engine",false) triggerClientEvent(player,"OnMotor", player) enginestate = false end if enginestate == false then setVehicleEngineState(source,false) triggerClientEvent("OffMotor", player) end this will do if engine is off it will turn it off ...
  8. function motor_func() local veh = getPedOccupiedVehicle(source) if veh then setVehicleEngineState(veh,not getVehicleEngineState(veh)) setElementData(veh,"engine",not getElementData(veh,"engine")) else setVehicleEngineState(veh,not getVehicleEngineState(veh)) setElementData(veh,"engine",not getElementData(veh,"engine")) end end function light_func() local veh = getPedOccupiedVehicle(source) if veh then if getVehicleOverrideLights(veh) ~= 2 then setVehicleOverrideLights(veh,2) else setVehicleOverrideLights(veh,1) end end end addEventHandler("onVehicleEnter",getRootElement(),function (player, seat) if seat == 0 then outputChatBox("Starte den Motor mit 'X' und die Lichter mit 'L'",player,0,125,0) local enginestate = getElementData(source,"engine") if not enginestate then setElementData(source,"engine",false) triggerClientEvent("OnMotor", player) enginestate = false end if enginestate == false then setVehicleEngineState(source,false) triggerClientEvent("OffMotor", player) end bindKey(player,"l","down",light_func) bindKey(player,"x","down",motor_func) end end) addEventHandler("onVehicleExit",getRootElement(),function (player, seat) if seat == 0 then unbindKey(player,"l","down",light_func) unbindKey(player,"x","down",motor_func) end end) Try that EDIT: triggerClientEvent("OnMotor", player) will trigger to show image for all players. you should have it like triggerClientEvent(player,"OnMotor", player)
  9. --determine whether color change can be made with a command cmd = true --the command to use thecmd = "neon" function neon(plr,cmd,r,g,b,a) if not r then openGui(plr) return true end if tonumber(tostring(r)) == nil then r,g,b,a = getColorFromString(r) end if not a then a = 200 end veh = getPedOccupiedveh(plr) if veh and r and g and b then model = getElementModel(veh) if canHaveNeon(veh) then if haveNeon(veh) then setNeonColor(veh,tonumber(r),tonumber(g),tonumber(b)) end end end end if cmd then addCommandHandler(thecmd,neon) end function setNeonColor(veh,r,g,b) setElementData(veh,"neonlight",tostring(r)..","..tostring(g)..","..tostring(b)..","..tostring(a)) for i,mark in ipairs(getElementsByType("marker")) do local type = getMarkerType(mark) if type == "corona" then local data1 = getElementData(veh,"neonMarker1") local data2 = getElementData(veh,"neonMarker2") if data1 == mark or data2 == mark then setMarkerColor(mark,r,g,b,80) else addNeon(veh,true) end end end return true end function haveNeon(veh) local data = getElementData(veh,"haveneon") if data then return true else return false end end function addNeon(veh,state) if getElementType(veh) == "vehicle" then if state then setElementData(veh,"haveneon",true) x,y,z = getElementPosition(veh) -- local exist = nil for i,mark in ipairs(getElementsByType("marker")) do data = getElementData(veh,"neonMarker1") if data == mark then local exist = mark end end if not exist then local marker1 = createMarker(x,y,z,"corona",2,0,0,0,0) attachElements(marker1,veh,0,-1,-1.2) setElementData(veh,"neonMarker1",marker1) local marker2 = createMarker(x,y,z,"corona",2,0,0,0,0) attachElements(marker2,veh,0,1,-1.2) setElementData(veh,"neonMarker2",marker2) end -- return true else setElementData(veh,"haveneon",false) setElementData(veh,"neonlight","off!!!") -- for i,mark in ipairs(getElementsByType("marker")) do local type = getMarkerType(mark) if type == "corona" then local data1 = getElementData(veh,"neonMarker1") local data2 = getElementData(veh,"neonMarker2") if data1 == mark or data2 == mark then setMarkerColor(mark,0,0,0,0) end end end -- return true end else return false end end function canHaveNeon(veh) model = getElementModel(veh) if veh and getElementType(veh) == "vehicle" then x = mayHaveNeon(model) return x else return false end end function mayHaveNeon(model) if model ~= 592 and model ~= 511 and model ~= 584 and model ~= 512 and model ~= 593 and model ~= 417 and model ~= 487 and model ~= 553 and model ~= 488 and model ~= 563 and model ~= 476 and model ~= 519 and model ~= 460 and model ~= 469 and model ~= 513 and model ~= 472 and model ~= 473 and model ~= 493 and model ~= 595 and model ~= 484 and model ~= 430 and model ~= 453 and model ~= 452 and model ~= 446 and model ~= 454 and model ~= 403 and model ~= 514 and model ~= 443 and model ~= 515 and model ~= 455 and model ~= 406 and model ~= 486 and model ~= 578 and model ~= 532 and model ~= 524 and model ~= 498 and model ~= 609 and model ~= 568 and model ~= 457 and model ~= 508 and model ~= 571 and model ~= 539 and model ~= 606 and model ~= 607 and model ~= 485 and model and model ~= 581 and model ~= 509 and model ~= 481 and model ~= 462 and model ~= 521 and model ~= 463 and model ~= 510 and model ~= 522 and model ~= 461 and model ~= 448 and model ~= 468 and model ~= 586 and model ~= 485 and model ~= 552 and model ~= 431 and model ~= 438 and model ~= 437 and model ~= 574 and model ~= 525 and model ~= 408 and model ~= 416 and model ~= 433 and model ~= 427 and model ~= 490 and model ~= 528 and model ~= 407 and model ~= 544 and model ~= 523 and model ~= 470 and model ~= 596 and model ~= 597 and model ~= 598 and model ~= 599 and model ~= 432 and model ~= 601 and model ~= 428 and model ~= 499 and model ~= 449 and model ~= 537 and model ~= 538 and model ~= 570 and model ~= 569 and model ~= 590 and model ~= 441 and model ~= 464 and model ~= 501 and model ~= 465 and model ~= 564 and model ~= 594 then return true else return false end end function deactivateNeon(veh) if getElementType(veh) == "vehicle" then setElementData(veh,"neonlight","off!!!") for i,mark in ipairs(getElementsByType("marker")) do local type = getMarkerType(mark) if type == "corona" then local data1 = getElementData(veh,"neonMarker1") local data2 = getElementData(veh,"neonMarker2") if data1 == mark or data2 == mark then setMarkerColor(mark,0,0,0,0) end end end return true else return false end end function openGui(plr) local veh = getPedOccupiedveh(plr) if haveNeon(veh) then triggerClientEvent(plr,"openNeonGui",root) end end addEventHandler("onPlayerJoin",root,function() for i,veh in ipairs(getElementsByType("vehicle")) do data = getElementData(veh,"neonlight") setElementData(veh,"neonlight",data) end end) for i,veh in ipairs(getElementsByType("vehicle")) do deactivateNeon(veh) end addEvent("closeNeonGui",true) addEventHandler("closeNeonGui",root,function(r,g,b) local veh = getPedOccupiedveh(source) setNeonColor(veh,r,g,b) end) Try that
  10. veh = getPedOccupiedVehicle(plr)
  11. local veh = getPedOccupiedVehicle(plr)
  12. Wei

    dx calculations

    I am making login gui like some multigamemode servers use to select gamemode I will use Login, Register and Forgot password...
  13. Wei

    dx calculations

    I've noticed, thanks Citizen for explanation!
  14. Wei

    dx calculations

    Thanks Solidsnake!
  15. Wei

    dx calculations

    yes but it would be still in middle of screen Edit* I mean like there would be 2 seperated rectangles that will together be in middle of screen
  16. Wei

    dx calculations

    I'm sorry I forgot to mention to test1 and test2 would be seperated by 10px.
  17. Wei

    dx calculations

    example = { {"test1"}; {"test2"}; } function draw() for index, value in ipairs (example) do dxDrawRectangle( pos1, pos2, 100, 50 ) end end addEventHandler("onClientRender", root, draw) Can someone explain me how I can get pos1 and pos2 to allways be in middle of screen ? I loosing my mind with this calculations -.- Thanks, Wei.
  18. It is basicaly the same. U can use what you wan't but if you call it a lot of times I would suggest you sqlite!
  19. GUIEditor_Label[2] = guiCreateLabel(279,570,103,143, tostring(getElementData(localPlayer, "level")),false) guiSetFont ( GUIEditor_Label[2], font2 ) local level = getElementData(localPlayer, "level") if (level >= 40) then guiLabelSetColor( GUIEditor_Label[2], 0, 247, 0) end
  20. GuiStaticImageLoadImage try using that
  21. Yes apache is running on the same machine. I've tested like this <!DOCTYPE html> <html> <body> <h1>My first PHP page</h1> <?php echo "Hello World!"; // Create connection $con=mysqli_connect("localhost","root","","rgaming"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } ?> </body> </html> Yes mysql server is running localy
×
×
  • Create New...