Jump to content

manawydan

Members
  • Posts

    980
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by manawydan

  1. some erros try make the script server-side
  2. eai pessoal, bom eu sei que não é legal fica pedindo coisas, mas se alguem sabe faze um mapa estilo medieval e puder me passa eu agradeço,(eu tentaria faze o mapa do zero para poderia coloca no mode de rpg medieval que estou fazendo), obrigado!
  3. if you want use trigger: server local Admins = {} function isPlayerAdmin(player) if(Admins[player]) then return true end return false end addEventHandler("onPlayerLogin",root, function() if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ))then if not(Admins[source])then Admins[source]= source triggerClientEvent("updateAdmins",source,Admins) end end end) addEventHandler("onPlayerQuit",root, function() if(Admins[source])then Admins[source]= nil triggerClientEvent("updateAdmins",source,Admins) end end) client local Admins = {} addEvent("updateAdmins",true) addEventHandler("updateAdmins",root, function(t) Admins = t end) function isPlayerAdmin(player) if(Admins[player]) then return true end return false end
  4. just use getElementData, elementData is syncronized(if you set in server or client both will have it)
  5. try this: client local startTick = nil local timeToEachCounter = 1000 local imageNumbers = 7 local imageCurrent = 0 function draw() local now = getTickCount() if(now - startTick >= timeToEachCounter)then startTick = now if(imageCurrent == imageNumbers)then removeEventHandler("onClientRender",root,draw) else imageCurrent = imageCurrent +1 end end dxDrawImage(305, 119, 110, 190,"imagens/contador1/"..imageCurrent..".png") end addEvent("onStartCounter",true) addEventHandler("onStartCounter",root, function() startTick = getTickCount() imageCurrent = 0 addEventHandler("onClientRender",root,draw) end) server -- server addCommandHandler("contar1", function(p) triggerClientEvent("onStartCounter",p) end)
  6. manawydan

    Showrom

    try createVehicle in client side
  7. you can use this: function isPlayerAdmin(player) if(getElementData(player,"Admin")) then return true end return false end addEventHandler("onPlayerLogin",root, function() if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ))then setElementData(source,"Admin",true) end end)
  8. manawydan

    Peds

    yes, you can use slothbot resource or make your custom ai
  9. try this no tested spawnyPojazdow={ {601, 122.98459625244,2066.1225585938,16.934089660645, 2, 0, 50}, for i=1,#spawnyPojazdow do ieh = createVehicle(spawnyPojazdow[i][1], spawnyPojazdow[i][2], spawnyPojazdow[i][3], spawnyPojazdow[i][4]) iehCol = createColSphere(spawnyPojazdow[i][2], spawnyPojazdow[i][3], spawnyPojazdow[i][4], 1.5) attachElements (iehCol, ieh, 0, 0, 0 ) setElementData(iehCol,"parent",ieh) setElementData(ieh,"parent",iehCol) setElementData(iehCol,"iehicle",true) setElementData(iehCol,"MAX_Slots",20) --Engine + Tires local tires,engine,parts = getiehicleAddonInfos (getElementModel(ieh)) setElementData(iehCol,"Tire_iniehicle",math.random(spawnyPojazdow[i][5],tires)) setElementData(iehCol,"Engine_iniehicle",math.random(spawnyPojazdow[i][6],engine)) setElementData(iehCol,"Parts_iniehicle",math.random(spawnyPojazdow[i][7],parts)) --iehicle_indentifikation setElementData(iehCol,"spawn",{spawnyPojazdow[i][1], spawnyPojazdow[i][2], spawnyPojazdow[i][3], spawnyPojazdow[i][4]}) --others setElementData(iehCol,"fuel",60) end
  10. i think setPedControlState and setPedAnimation are not "friends"
  11. try change the event: addEvent( "bot_Forwards", true ) function Bforward () if (isElement(source)) then setPedControlState( source, "forwards", true ) end end addEventHandler( "bot_Forwards", getRootElement(), Bforward ) instead setPedControlState try put setPedAnimation(source,arguments..) and in : addEvent( "bot_Stop", true ) function Bstop ( ) if (isElement(source)) then setPedControlState( source, "forwards", false ) end end addEventHandler( "bot_Stop", getRootElement(), Bstop ) try this: addEvent( "bot_Stop", true ) function Bstop ( ) if (isElement(source)) then setPedControlState( source, "forwards", false ) setPedAnimation(source) end end addEventHandler( "bot_Stop", getRootElement(), Bstop )
  12. try like this: --server function setAiControl(ai,control,value) triggerClientEvent("onAiSetControl",ai,control,value) end function AIo ( playerSource ) local x, y, z = getElementPosition ( playerSource ) local ped = createPed(194,x,y,z) local vehicle = createVehicle ( 411, x, y, z) warpPedIntoVehicle (ped, vehicle) setAiControl(ped,'accelerate', 1) end addCommandHandler ( "AI", AIo) -- client addEvent("onAiSetControl",true) addEventHandler("onAiSetControl",root, function(controlName,value) setPedAnalogControlState(source,controlName, value) end)
  13. you can try change setPedControlState(in walk) to setPedAnmation(i make my own ai and work)
  14. one example: --server addCommandHandler("handbrake", function(p) if(isPedInVehicle(p))then triggerClientEvent("onHandbrakeSoundStart",p) end end) --client addEvent("onHandbrakeSoundStart",true) addEventHandler("onHandbrakeSoundStart",root, function() local x,y,z = getElementPosition(source) playSound3D("mysong.mp3",x,y,z) end)
  15. i try make one new code and work function orderTable(t) local nt = {} for i=1,#t do if(t[i] ~= nil)then table.insert(nt,t[i]) end end return nt end
  16. ciber how do you calculate the time of Execution?
×
×
  • Create New...