Jump to content

kevincouto6

Members
  • Posts

    235
  • Joined

  • Last visited

Everything posted by kevincouto6

  1. Eu estou tentando de todas maneiras porem sempre acontece algum erro achei melhor voltar a pedir ajuda ERROR:Mission/mission.lua:16:bad argument #1 to'pairs'(table expected, got nill) zombiesKilled = 0 local zedsTable = { { 198, 158, 107, 108 }, {48, 18, 79, 23 } } function ZedMissionWin () zombiesKilled = 5 outputChatBox( "Good job, mission completed!" ) givePlayerMoney ( thePlayer, 30000 ) end function ZedMissionCheckKill( mission ) for _, id in pairs( zedsTable[tonumber(mission)] ) do zombiesKilled = zombiesKilled+1 outputDebugString ("A zed was killed, "..(zombiesKilled).." zeds left.") end if zombiesKilled >= 5 then ZedMissionWin () end end function startZedMission () outputChatBox ( "Your Get Mission" ) addEventHandler ( "onClientPedWasted", root, ZedMissionCheckKill ) end addCommandHandler ( "mission", startZedMission )
  2. os zombies ja estão no server, tem que apenas mata-los para completar mission, porem queria sera-los por classe, para fazer vairas mission exemplo Mission 1 Classe A "ID zombies" { 198, 158, 107 e 108 } Mission 2 Classe A "ID zombies2" { 48, 18, 79 e 23 } _______________________________________________________________ Voçe poderia me dar dicas ou me ajudar a arruamar o scritp ?
  3. Olá, este é um script Server, queria criar uma missião de mata 5 zombie"PED" acada "PED" morto zombiesKilled+1 Isso significa que quando tiver if zombiesKilled >= 5 then a missão sera completada pois eu não consigo especificar qual zombie deve ser morto
  4. Olá a todos tenho um script,porem não consigo especificar qual deve ser morto Exemplo Matar 5 Zombies, Não qualquer zombie um zombie especifico apenas. alguem pode me ajudar ? Quero especificar o id porem não esta sendo possivel zombiesKilled = 0 function ZedMissionWin () zombiesKilled = 5 outputChatBox( "Good job, mission completed!" ) givePlayerMoney ( 50000 ) end function ZedMissionCheckKill ( killer ) local zed = getElementsByType (107,sorcer) if zed == true and killer == localPlayer then zombiesKilled = zombiesKilled+1 outputDebugString ("A zed was killed, "..(zombiesKilled).." zeds left.") end if zombiesKilled >= 5 then ZedMissionWin () end end function startZedMission () outputChatBox ( "Your Get Mission" ) addEventHandler ( "onClientPedWasted", root, ZedMissionCheckKill ) end addCommandHandler ( "mission", startZedMission )
  5. Estou muito agradecido, Obrigado
  6. poderia me dar algum exemplo não estou conseguindo usar triggerServerEvent, porfavor
  7. Eai pessoal, bom queria a ajuda de voçes mais uma vez, eu criei uma Windons for panel mission,porem não sei como add a missião no painel e vou lhes mostrar aki em baixo I wanted to add a mission to windows gui that I created, but I do not know how to do it, could I do it for myself, or hollow out how? Gui Windons Client GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() missionwindow = guiCreateWindow(558, 242, 257, 319, "Zombie", false) guiWindowSetSizable(missionwindow, false) guiSetVisible(missionwindow, false) GUIEditor.gridlist[1] = guiCreateGridList(9, 21, 238, 253, false, missionwindow) guiGridListAddColumn(GUIEditor.gridlist[1], "Missions", 0.9) fistmiss = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(fistmiss, 0, 1, "Transportation Weapons", false, false) AcceptButton = guiCreateButton(9, 284, 76, 25, "ACCEPT", false, missionwindow) guiSetProperty(AcceptButton, "NormalTextColour", "FED6D800") ExitButton = guiCreateButton(173, 284, 74, 25, "EXIT", false, missionwindow) guiSetProperty(ExitButton, "NormalTextColour", "FE29D900") AbandonButton = guiCreateButton(91, 284, 76, 25, "ABANDON", false, missionwindow) guiSetProperty(AbandonButton, "NormalTextColour", "FEDA0000") end ) --if you want add Marker# {}, Mark = { {-2404.00000, -598.00000, 132}, } --Marker local Marker1 = createMarker(-2404.00000, -598.00000, 132, "cylinder", 1.5, 250,250,0) for k,v in ipairs (Mark) do z = v[3] -1 Marker = createMarker ( v[1], v[2], z, "cylinder", 1.5, 255, 255, 0, 255 ) addEventHandler('onClientMarkerHit', Marker, function ( hitPlayer ) if ( hitPlayer == localPlayer ) then guiSetVisible (missionwindow, true ) showCursor( true ) end end ) end addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) local me = not guiGetVisible(missionwindow) if ( source == ExitButton ) then guiSetVisible(missionwindow,me ) showCursor( me ) end end ) Esta aki e a mission que quero add a RowList para ACEPTED and DECLINED Mission Mfim = createMarker ( 858.41198730469, -583.17816162109, 18.150485992432 -1, "cylinder", 2, 0 ,255 ,0, 255) Bfim = createBlipAttachedTo ( Mfim, 19 ) setElementVisibleTo ( Bfim, root, false ) veh = {} function incio (source) if fistmiss (source, AcceptButton) then if veh[source] and isElement( veh[source] ) then destroyElement ( veh[source] ) veh[source] = nil end x,y,z = getElementPosition(source) Trabalho = true veh[source] = createVehicle(514,290.74652099609, 2041.4344482422, 18.340299606323,0,0,270) setElementVisibleTo ( Bfim, source, true ) warpPedIntoVehicle ( source, veh[source] ) outputChatBox ("#ffff00Take this Flag Card without leaving the vehicle !",source,0,0,0,true ) end end addEventHandler( "onMarkerHit", Minicio, incio ) function fim (source) if veh[source] and isElement(veh[source]) then destroyElement (veh[source]) givePlayerMoney(source,200000) setElementVisibleTo ( Bfim, source, false ) outputChatBox("#00ff00você Ganhou $10000 Pela Entrega,Parabéns!",source,0,0,0,true) else end end addEventHandler("onMarkerHit",Mfim ,fim) function sair (source) if (veh[source]) and isElement(veh[source]) then setElementVisibleTo ( Bfim, source, false ) destroyElement (veh[source]) outputChatBox("#ff0000Você Perdeu o Trabalho Ao Sair Do Veículo", source ,0,0,0,true) else end end addEventHandler ( "onVehicleExit", getRootElement(), sair ) Se puderem me ajudar com isso ficaria muito grato a vcs
  8. Muito obrigado pela ajuga,love
  9. kevincouto6

    tank

    Hello, the errors are at the time of add permissions to create the AREA, if anyone can help me pf?
  10. tem algum erro e não estou conseguindo resolver function area ( setArea ) createColRectangle ( 95, 1700, 325,450) createRadarArea ( 95, 1700, 325,450, 0, 0, 0, 175 ) outputChatBox("Zone Created", source, 255, 0, 0) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Owner")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Moderator")) then end end addCommandHandler ( "setEventArea", area) Quero que essa função seja permitida apenas para "Lead Admin,Owner, moderator " Porem não sei como criar comando para desativar a "area", porfavor alem pode ajudar ? Corrigi varios erros porem ainda sim continua dando erros
  11. kevincouto6

    tank

    Help me --Event local Area = createColRectangle ( 95, 1700, 325, 450 ) outputChatBox( "Enabled Event", getRootElement(), 255, 255, 0) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Lead Administrator" ) ) then end addCommandHandler ( "setEventArea", setArea ) function create_vehicle ( player ) if isElementWithinColShape ( player, Area ) then if isElement( getElementData ( player, "tank" ) ) then destroyElement ( getElementData ( player, "tank" ) ) end local x, y, z = getElementPosition ( player ) local tank = createVehicle ( 432, x, y, z + 10 ) warpPedIntoVehicle ( player, tank ) setElementData ( player, "tank", tank ) end end addCommandHandler ( "tank", create_vehicle ) addEventHandler("onVehicleExit", root, function() local destroyTimer = setTimer( function( tank ) if isElement( tank ) then destroyElement( tank ) end end, 5000, 1, source) setElementData(source, "destroyTimer", destroyTimer) end) --hydras-- function create_vehicle ( player ) if isElementWithinColShape ( player, Area ) then if isElement( getElementData ( player, "hydras" ) ) then destroyElement ( getElementData ( player, "hydras" ) ) end local x, y, z = getElementPosition ( player ) local hydras = createVehicle ( 520, x, y, z + 10 ) warpPedIntoVehicle ( player, hydras ) setElementData ( player, "hydras", hydras ) end end addCommandHandler ( "hydras", create_vehicle ) addEventHandler("onVehicleExit", root, function() local destroyTimer = setTimer( function( hydras ) if isElement( hydras ) then destroyElement( hydras ) end end, 5000, 1, source) -- vehicle is not defined here, so i wrote source instead of 'vehicle' setElementData(source, "destroyTimer", destroyTimer) -- same end)
  12. I wanted to add a mission to windows gui that I created, but I do not know how to do it, could I do it for myself, or hollow out how? Gui Windons Client GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() missionwindow = guiCreateWindow(558, 242, 257, 319, "Zombie", false) guiWindowSetSizable(missionwindow, false) guiSetVisible(missionwindow, false) GUIEditor.gridlist[1] = guiCreateGridList(9, 21, 238, 253, false, missionwindow) guiGridListAddColumn(GUIEditor.gridlist[1], "Missions", 0.9) fistmiss = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(fistmiss, 0, 1, "Transportation Weapons", false, false) AcceptButton = guiCreateButton(9, 284, 76, 25, "ACCEPT", false, missionwindow) guiSetProperty(AcceptButton, "NormalTextColour", "FED6D800") ExitButton = guiCreateButton(173, 284, 74, 25, "EXIT", false, missionwindow) guiSetProperty(ExitButton, "NormalTextColour", "FE29D900") AbandonButton = guiCreateButton(91, 284, 76, 25, "ABANDON", false, missionwindow) guiSetProperty(AbandonButton, "NormalTextColour", "FEDA0000") end ) --if you want add Marker# {}, Mark = { {-2404.00000, -598.00000, 132}, } --Marker local Marker1 = createMarker(-2404.00000, -598.00000, 132, "cylinder", 1.5, 250,250,0) for k,v in ipairs (Mark) do z = v[3] -1 Marker = createMarker ( v[1], v[2], z, "cylinder", 1.5, 255, 255, 0, 255 ) addEventHandler('onClientMarkerHit', Marker, function ( hitPlayer ) if ( hitPlayer == localPlayer ) then guiSetVisible (missionwindow, true ) showCursor( true ) end end ) end addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) local me = not guiGetVisible(missionwindow) if ( source == ExitButton ) then guiSetVisible(missionwindow,me ) showCursor( me ) end end ) Here is the mission, you can modify it to start in the windons GUI Mission Mfim = createMarker ( 858.41198730469, -583.17816162109, 18.150485992432 -1, "cylinder", 2, 0 ,255 ,0, 255) Bfim = createBlipAttachedTo ( Mfim, 19 ) setElementVisibleTo ( Bfim, root, false ) veh = {} function incio (source) if fistmiss (source, AcceptButton) then if veh[source] and isElement( veh[source] ) then destroyElement ( veh[source] ) veh[source] = nil end x,y,z = getElementPosition(source) Trabalho = true veh[source] = createVehicle(514,290.74652099609, 2041.4344482422, 18.340299606323,0,0,270) setElementVisibleTo ( Bfim, source, true ) warpPedIntoVehicle ( source, veh[source] ) outputChatBox ("#ffff00Take this Flag Card without leaving the vehicle !",source,0,0,0,true ) end end addEventHandler( "onMarkerHit", Minicio, incio ) function fim (source) if veh[source] and isElement(veh[source]) then destroyElement (veh[source]) givePlayerMoney(source,200000) setElementVisibleTo ( Bfim, source, false ) outputChatBox("#00ff00você Ganhou $10000 Pela Entrega,Parabéns!",source,0,0,0,true) else end end addEventHandler("onMarkerHit",Mfim ,fim) function sair (source) if (veh[source]) and isElement(veh[source]) then setElementVisibleTo ( Bfim, source, false ) destroyElement (veh[source]) outputChatBox("#ff0000Você Perdeu o Trabalho Ao Sair Do Veículo", source ,0,0,0,true) else end end addEventHandler ( "onVehicleExit", getRootElement(), sair )
  13. I wanted to add a mission to windows gui that I created, but I do not know how to do it, could I do it for myself, or hollow out how?

     

    Gui Windons Client

    GUIEditor = {
        gridlist = {},
        window = {},
        button = {}
    }
    addEventHandler("onClientResourceStart", resourceRoot,
    
    function()
        missionwindow = guiCreateWindow(558, 242, 257, 319, "Zombie HELL PARTY RELOADED", false)
        guiWindowSetSizable(missionwindow, false)
    	guiSetVisible(missionwindow, false)
        GUIEditor.gridlist[1] = guiCreateGridList(9, 21, 238, 253, false, missionwindow)
        guiGridListAddColumn(GUIEditor.gridlist[1], "Missions", 0.9)
        fistmiss = guiGridListAddRow(GUIEditor.gridlist[1])
        guiGridListSetItemText(fistmiss, 0, 1, "Transportation Weapons", false, false)
    	AcceptButton = guiCreateButton(9, 284, 76, 25, "ACCEPT", false, missionwindow)
        guiSetProperty(AcceptButton, "NormalTextColour", "FED6D800")
        ExitButton = guiCreateButton(173, 284, 74, 25, "EXIT", false, missionwindow)
        guiSetProperty(ExitButton, "NormalTextColour", "FE29D900")
        AbandonButton = guiCreateButton(91, 284, 76, 25, "ABANDON", false, missionwindow)
        guiSetProperty(AbandonButton, "NormalTextColour", "FEDA0000")    
    end
    )
    --if you want add Marker# {},
    Mark = {
    {-2404.00000, -598.00000, 132},
    }
    --Marker
    local Marker1 = createMarker(-2404.00000, -598.00000, 132, "cylinder", 1.5, 250,250,0)
    
    for k,v in ipairs (Mark) do
    z = v[3] -1
    Marker = createMarker ( v[1], v[2], z, "cylinder", 1.5,  255, 255, 0, 255 )
    addEventHandler('onClientMarkerHit', Marker,
        function ( hitPlayer )
            if ( hitPlayer == localPlayer ) then
                guiSetVisible (missionwindow, true )
                showCursor( true )
            end
        end
    )
    end
    
    addEventHandler ("onClientGUIClick", getRootElement(), 
    function(button, state, absoluteX, absoluteY)
    local me = not guiGetVisible(missionwindow)
    	if ( source == ExitButton ) then
    		guiSetVisible(missionwindow,me )
    		showCursor( me )
    	end
    end
    )

    Here is the mission, you can modify it to start in the windons GUI

    Mission 

    Mfim = createMarker ( 858.41198730469, -583.17816162109, 18.150485992432 -1, "cylinder", 2, 0 ,255 ,0, 255)
    
    Bfim = createBlipAttachedTo ( Mfim, 19 )
    setElementVisibleTo ( Bfim, root, false )
    
    veh = {}
    function incio (source)
    if fistmiss (source, AcceptButton) then
    if veh[source] and isElement( veh[source] ) then destroyElement ( veh[source] )
    veh[source] = nil
    end
    x,y,z = getElementPosition(source)
    Trabalho = true
    veh[source] = createVehicle(514,290.74652099609, 2041.4344482422, 18.340299606323,0,0,270)
    setElementVisibleTo ( Bfim, source, true )
    warpPedIntoVehicle ( source, veh[source] )
     outputChatBox ("#ffff00Take this Flag Card without leaving the vehicle !",source,0,0,0,true )
    end
    end
    addEventHandler( "onMarkerHit", Minicio, incio ) 
    
    function fim (source)
    if veh[source] and isElement(veh[source]) then
    destroyElement (veh[source])
    givePlayerMoney(source,200000)
    setElementVisibleTo ( Bfim, source, false )
    outputChatBox("#00ff00você Ganhou $10000 Pela Entrega,Parabéns!",source,0,0,0,true)
    else
    end
    end
    addEventHandler("onMarkerHit",Mfim ,fim)
    
    function sair (source)
    if (veh[source]) and isElement(veh[source]) then
    setElementVisibleTo ( Bfim, source, false )
    destroyElement (veh[source])
    outputChatBox("#ff0000Você Perdeu o Trabalho Ao Sair Do Veículo", source ,0,0,0,true)
    else
    end
    end
    addEventHandler ( "onVehicleExit", getRootElement(), sair )

     

  14. But it is still not possible to complete the mission! META must be client or server
  15. thanks, but you could allow the command to work just inside createRadarArea
  16. Could someone help me I am not able to specify the PED ID that should be killed? zombiesKilled = 0 function ZedMissionWin () zombiesKilled = 0 outputChatBox("Good job, mission completed!") givePlayerMoney ( 50000 ) removeEventHandler("onClientPedWasted",root,ZedMissionCheckKill) end function ZedMissionCheckKill (killer,weapon) local zed = getElementModel ( ped ) if id == 105 or id == 107 then if zed == true and killer == localPlayer then zombiesKilled = zombiesKilled+1 outputDebugString("A zed was killed, "..(0+zombiesKilled).." zeds left.") end end if zombiesKilled >= 5 then ZedMissionWin() end end function startZedMission() outputChatBox("Your Get Mission") addEventHandler("onClientPedWasted",root,ZedMissionCheckKill) end addCommandHandler("mission", startZedMission)
  17. Hello I wanted to ask for help with this script, can anyone help me? * Allow command can only be used within AREA WARNING: rhinos / rhinos.lua: 8 Bad argument @ "warpPedIntoVehicle" [Expected ped at argument 1, go string "tank"] the Warp and for the Player that use the command! local Radar = createRadarArea ( 95, 1700, 325, 450, 0, 0, 0, 170 ) local Area = createColRectangle ( 95, 1700, 325, 450 ) function scriptCreateTank ( thePlayer ) local luckyBugger = getLocalPlayer() -- get the local player local x, y, z = getElementPosition ( luckyBugger ) -- retrive the player's position veh = createVehicle ( 432, x, y, z + 10 ) -- create the tank 10 units above them warpPedIntoVehicle ( thePlayer,veh ) outputChatBox ( "You got Tank'd!", 255, 0, 0) end addCommandHandler ( "tank", scriptCreateTank) function exitVeh (source) if (veh) and isElement(veh) then destroyElement (veh) else end end addEventHandler ( "onVehicleExit", getRootElement(), exitVeh )
  18. --FPS.lua-- checking = 0 carchecking = 0 wright = false wleft = false wback = false function FPSStart (startedresource) if startedresource == getThisResource() then local skin = engineLoadTXD ( "160.txd" ) -- arm skin engineImportTXD ( skin, 160 ) local x,y,z = getElementPosition( getLocalPlayer() ) Body = createObject (991, x, y, z ) setElementParent(Body, getLocalPlayer()) attachElements ( Body, getLocalPlayer(), 0, -0.1, 0.45, 0, 90, 0) setElementAlpha( Body, 0) setElementData ( getLocalPlayer(), "blocker", Body ) realskin = getElementModel(getLocalPlayer()) if realskin == 160 then realskin = 200 end realvoice1, realvoice2 = getPedVoice (getLocalPlayer()) setElementModel ( getLocalPlayer(), 160 ) setPedVoice (getLocalPlayer(),realvoice1,realvoice2) local allcars = getElementsByType ( "vehicle", getRootElement(), false) for theKey,theVehicle in ipairs(allcars) do setElementCollidableWith ( Body, theVehicle, false ) end bindKey ( "left", "both", sidewalking ) bindKey ( "right", "both", sidewalking ) bindKey ( "backwards", "both", sidewalking ) bindKey ( "fire", "both", autoAimMode ) end end addEventHandler ( "onClientResourceStart", getRootElement(), FPSStart) function clearcars() if getElementType(source) == "vehicle" then setElementCollidableWith ( Body, source, false ) end end addEventHandler( "onClientElementStreamIn", getRootElement(),clearcars) function invisOnSpawn() realskin = getElementModel(getLocalPlayer()) if realskin == 160 then realskin = 200 end realvoice1, realvoice2 = getPedVoice (getLocalPlayer()) setElementModel ( getLocalPlayer(), 160 ) setPedVoice (getLocalPlayer(),realvoice1,realvoice2) end addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), invisOnSpawn ) function climbcheck() if isPlayerDead(getLocalPlayer())== false and getControlState("aim_weapon") == false then setElementCollisionsEnabled(Body, false) if checking == 0 then checking = 1 stopclimbcheck = setTimer ( stopCcheck, 1200, 1 ) addEventHandler ("onClientPreRender", getRootElement(), areyouclimbing) elseif checking == 1 then if isTimer(stopclimbcheck) then killTimer(stopclimbcheck) end stopclimbcheck = setTimer ( stopCcheck, 1200, 1 ) end end end bindKey ("jump", "down", climbcheck ) function stopCcheck() local currentmode = getElementModel ( getLocalPlayer()) if currentmode == 160 then setElementCollisionsEnabled(Body, true) end removeEventHandler("onClientPreRender", getRootElement(), areyouclimbing) setCameraTarget (getLocalPlayer()) checking = 0 end function areyouclimbing() hx,hy,hz = getPedBonePosition ( getLocalPlayer(), 8 ) local rot = getPedRotation (getLocalPlayer()) radRot = math.rad ( rot ) local radius = .5 local tx = hx + radius * math.sin(radRot) local ty = hy + -(radius) * math.cos(radRot) local tz = hz setCameraMatrix(tx,ty,tz,hx,hy,hz) if ( isPedDoingTask ( getLocalPlayer(), "TASK_SIMPLE_CLIMB" ) ) then if isTimer(stopclimbcheck) then killTimer(stopclimbcheck) doneclimbyet = setTimer ( finishCcheck, 400, 1 ) end end end function finishCcheck() if ( isPedDoingTask ( getLocalPlayer(), "TASK_SIMPLE_CLIMB" ) ) then doneclimbyet = setTimer ( finishCcheck, 400, 1 ) else finishedclimbing() end end function finishedclimbing() checking = 0 removeEventHandler("onClientPreRender", getRootElement(), areyouclimbing) local currentmode = getElementModel ( getLocalPlayer()) if currentmode == 160 then setElementCollisionsEnabled(Body, true) end setCameraTarget (getLocalPlayer()) end function FPSStop (startedresource) if startedresource == getThisResource() then setElementModel ( getLocalPlayer(), realskin ) setPedVoice (getLocalPlayer(),realvoice1,realvoice2) setCameraTarget (getLocalPlayer()) end end addEventHandler ( "onClientResourceStop", getRootElement(), FPSStop) function shakeCamera(weapon) x,y,z = getPedBonePosition ( getLocalPlayer(), 26 ) if weapon == 24 then createExplosion ( x,y,z + 10,12,false,0.4,false) elseif weapon == 25 then createExplosion ( x,y,z + 10,12,false,0.5,false) elseif weapon == 26 then createExplosion ( x,y,z + 10,12,false,0.7,false) elseif weapon == 27 then createExplosion ( x,y,z + 10,12,false,0.5,false) elseif weapon == 29 then createExplosion ( x,y,z + 10,12,false,0.2,false) elseif weapon == 30 then createExplosion ( x,y,z+10,12,false,0.2,false) elseif weapon == 31 then createExplosion ( x,y,z + 10,12,false,0.3,false) elseif weapon == 33 then createExplosion ( x,y,z + 10,12,false,0.3,false) elseif weapon == 34 then createExplosion ( x,y,z + 10,12,false,0.3,false) end end addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), shakeCamera ) function carcheck(player) if player == getLocalPlayer() then if carchecking ~= 1 then carchecking = 1 local currentmode = getElementModel ( getLocalPlayer()) if currentmode == 160 then abortCarEnterCheck = setTimer ( checkCarTask, 100, 1 ) setElementCollisionsEnabled(Body, false) addEventHandler ("onClientPreRender", getRootElement(), areyougettingin) end end end end addEventHandler ( "onClientVehicleStartEnter", getRootElement(), carcheck ) addEventHandler ( "onClientVehicleEnter", getRootElement(), carcheck ) function carfollowupcheck() if (isPedInVehicle(getLocalPlayer()) == true) then -- if player is in car setElementModel ( getLocalPlayer(), realskin ) setElementCollisionsEnabled(Body, false) setPedVoice (getLocalPlayer(),realvoice1,realvoice2) setCameraTarget (getLocalPlayer()) -- setCameraView(0) else setElementCollisionsEnabled(Body, true) setPedVoice (getLocalPlayer(),realvoice1,realvoice2) setElementModel ( getLocalPlayer(), 160 ) setCameraTarget (getLocalPlayer()) end end function areyougettingin() hx,hy,hz = getPedBonePosition ( getLocalPlayer(), 8 ) local rot = getPedRotation (getLocalPlayer()) radRot = math.rad ( rot ) local radius = .5 local tx = hx + radius * math.sin(radRot) local ty = hy + -(radius) * math.cos(radRot) local tz = hz setCameraMatrix(tx,ty,tz,hx,hy,hz) end function checkCarTask() local stask = getPedSimplestTask(getLocalPlayer()) if (isPedInVehicle(getLocalPlayer()) == true) then -- if player is in car removeEventHandler("onClientPreRender", getRootElement(), areyougettingin) carchecking = 0 CarFollowUp = setTimer ( carfollowupcheck, 100, 1 ) setElementModel ( getLocalPlayer(), realskin ) setPedVoice (getLocalPlayer(),realvoice1,realvoice2) setCameraTarget (getLocalPlayer()) -- setCameraView(0) elseif (stask == "TASK_SIMPLE_CAR_GET_IN") or (stask == "TASK_SIMPLE_GO_TO_POINT") or (stask == "TASK_SIMPLE_CAR_OPEN_DOOR_FROM_OUTSIDE") or (stask == "TASK_SIMPLE_CAR_ALIGN") or (stask == "TASK_SIMPLE_CAR_CLOSE_DOOR_FROM_INSIDE") or (stask == "TASK_SIMPLE_CAR_SHUFFLE") or (stask == "TASK_SIMPLE_CAR_DRIVE") or (stask == "TASK_SIMPLE_ACHIEVE_HEADING") then -- if player is still getting in abortCarEnterCheck = setTimer ( checkCarTask, 100, 1 ) elseif (isPedInVehicle(getLocalPlayer()) == false) then --enter vehicle was aborted setElementCollisionsEnabled(Body, true) removeEventHandler("onClientPreRender", getRootElement(), areyougettingin) carchecking = 0 setCameraTarget (getLocalPlayer()) CarFollowUp = setTimer ( carfollowupcheck, 100, 1 ) end end function carexit(player) if player == getLocalPlayer() then setElementCollisionsEnabled(Body, true) setTimer ( setElementModel, 500, 1, getLocalPlayer(), 160 ) setTimer ( setPedVoice, 500, 1, getLocalPlayer(), realvoice1,realvoice2 ) end end addEventHandler ( "onClientVehicleStartExit", getRootElement(), carexit ) addEventHandler ( "onClientVehicleExit", getRootElement(), carexit ) function changestatus (dataName) if source == getLocalPlayer() and dataName == "usemode" then if (isPedInVehicle(source) == false) and (isPlayerDead(getLocalPlayer())== false) then if (getElementData ( source, "usemode" ) == true ) then setElementCollisionsEnabled(Body, false) setElementModel ( getLocalPlayer(), realskin ) setPedVoice (getLocalPlayer(),realvoice1,realvoice2) setCameraTarget(getLocalPlayer()) elseif (getElementData ( source, "usemode" ) == false ) then setElementCollisionsEnabled(Body, true) setElementModel ( getLocalPlayer(), 160 ) setPedVoice (getLocalPlayer(),realvoice1,realvoice2) end end end end addEventHandler( "onClientElementDataChange", getRootElement(), changestatus ) function zwasted ( killer, weapon, bodypart ) local x,y,z = getElementPosition( getLocalPlayer()) setCameraMatrix(x, y, z-.8, x, y, z+1) end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), zwasted ) function updateCamera() if checking == 0 and carchecking == 0 and wright == false and wleft == false or wback == true then x,y,z,tx,ty,tz = getCameraMatrix() newangle = (( 360 - math.deg ( math.atan2 ( ( x - tx ), ( y - ty ) ) ) ) % 360)-180 setPedRotation( getLocalPlayer(), newangle ) end end addEventHandler ( "onClientPreRender", getRootElement(), updateCamera ) function sidewalking(key, keystate) if ( keystate == "down" ) then if key == "left" then wleft = true elseif key == "right" then wright = true elseif key == "backwards" then wback = true end elseif ( keystate == "up" ) then if key == "left" then wleft = false elseif key == "right" then wright = false elseif key == "backwards" then wback = false end end end function autoAimMode( key, keystate) if keystate == "down" then setControlState("aim_weapon", true) else setControlState("aim_weapon", false) end end --fps_server.lua-- function resourceStart ( resource ) if resource == getThisResource() then local allplayers = getElementsByType ( "player" ) for pKey,thep in ipairs(allplayers) do bindPlayer(thep) end end end addEventHandler ( "onResourceStart", getRootElement(), resourceStart ) function bindPlayer(player) if (player) then bindKey ( player, "backwards", "both", strafe ) else if isElement(source) then bindKey ( source, "backwards", "both", strafe ) end end end addEventHandler ( "onPlayerJoin", getRootElement(), bindPlayer ) function strafe(player, key, keystate) if keystate == "up" then setPedAnimation(player) else setPedAnimation( player, "ped", "FightSh_BWD", -1, true, true, false) end end --Meta-- <meta> <info author="Slothman and EvgeniZ" name="truefps" version="1" type="script"/> <script src="fps.lua" type="client"/> <script src="fps_server.lua" type="server"/> <file src="160.txd" /> </meta> Could someone help me add the / fp command to open the camera?
  19. kevincouto6

    Help

    @Zorgman Can anyone help me with this zombiesKilled = 5 function ZedMissionWin () zombiesKilled = 5 outputChatBox("Good job, mission completed!") givePlayerMoney ( 50000 ) removeEventHandler("onClientPedWasted",root,ZedMissionCheckKill) end function pedID getElementsByType ( "ped",15,25) end function ZedMissionCheckKill (killer,weapon) local zed = getElementData(source,"pedID") if zed == true and killer == localPlayer then zombiesKilled = zombiesKilled+1 outputDebugString("A zed was killed, "..(5-zombiesKilled).." zeds left.") end if zombiesKilled >= 5 then ZedMissionWin() end end function startZedMission() outputChatBox("mission") addEventHandler("onClientPedWasted",root,ZedMissionCheckKill) end addCommandHandler("mis", startZedMission)
  20. Olá pessoas dinheiro e XP eu add, porem não posso adicionar id ao ped poderia me passar um function ou agora para eu acrecentar no scripts ?
  21. Hello everyone, the script is loading on the server but does not open, and no error appears
  22. Recourse starts normally but I can not open windows
×
×
  • Create New...