Jump to content

Walid

Members
  • Posts

    1,491
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Walid

  1. sorry i didn't play DayZ gamemode, but i think the last 3 values are the coordination of the item X , Y , Z. {"item name","model id"," X ","Y","Z"},
  2. function startDrawing_CMD() if(drawingPanel == false) then addEventHandler("onClientPreRender", root, draw); setTimer(cancelClientRender,5000,1) drawingPanel = true; end end addEvent("SeeGui",true) addEventHandler("SeeGui",root,startDrawing_CMD) -- remove the event function cancelClientRender() removeEventHandler("onClientPreRender",root, draw) return true end
  3. removeEventHandler ()
  4. Walid

    Disable F11 Map

    function disableF11Map ( ) toggleControl("radar", false) end addEventHandler ( "onClientResourceStart", resourceRoot, disableF11Map )
  5. Try this : -- server side: function isReady(_,acc) if acc and not isGuestAccount(acc) then triggerClientEvent(source,"HudGtaV",source) end end addEventHandler("onPlayerLogin",root,isReady) -- Client side local screenW,screenH = guiGetScreenSize() local resW, resH = 1280, 720 local x, y = (screenW/resW), (screenH/resH) local draw = false local hudTable = {"ammo","armour","clock","health","money","weapon","wanted","area_name","vehicle_name","breath","clock"} function HudGtaV ( ) if draw then dxDrawImage(x*1145, y*110, 100, 50, "img/"..getPedWeapon(getLocalPlayer())..".png") local money = string.format("%08d", getPlayerMoney(getLocalPlayer())) dxDrawBorderedText("$"..money,x*1120, y*50, x*1358, y*40,tocolor(73,208,141,255),1.0,"pricedown","left","top",false,false,false) showammo1 = getPedAmmoInClip (localPlayer,getPedWeaponSlot(localPlayer)) showammo2 = getPedTotalAmmo(localPlayer)-getPedAmmoInClip(localPlayer) dxDrawBorderedText("".. showammo2 ,x*1150, y*75, x*1205, y*40,tocolor(255, 255, 255,255),1.0,"pricedown","right","top",false,false,false) dxDrawBorderedText("".. showammo1 ,x*1212, y*75, x*750, y*40,tocolor(190, 190, 190,255),1.0,"pricedown","left","top",false,false,false) local altura = 25 local imageL, imageA = 25,25 local star01, star02, star03, star04, star05, star06 = 1220, 1193, 1165, 1138, 1110, 1080 local image = "wanted/star.png" wanted = getPlayerWantedLevel (getLocalPlayer()) if wanted == 1 then dxDrawImage(x*star01, y*altura, x*imageL, y*imageA, image) -- star 01 dxDrawImage(x*star02, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 02 --fundo dxDrawImage(x*star03, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 03 --fundo dxDrawImage(x*star04, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 04 --fundo dxDrawImage(x*star05, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 05 --fundo dxDrawImage(x*star06, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 06 --fundo end if wanted == 2 then dxDrawImage(x*star01, y*altura, x*imageL, y*imageA, image) -- star 01 dxDrawImage(x*star02, y*altura, x*imageL, y*imageA, image) -- star 02 dxDrawImage(x*star03, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 03 --fundo dxDrawImage(x*star04, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 04 --fundo dxDrawImage(x*star05, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 05 --fundo dxDrawImage(x*star06, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 06 --fundo end if wanted == 3 then dxDrawImage(x*star01, y*altura, x*imageL, y*imageA, image) -- star 01 dxDrawImage(x*star02, y*altura, x*imageL, y*imageA, image) -- star 02 dxDrawImage(x*star03, y*altura, x*imageL, y*imageA, image) -- star 03 dxDrawImage(x*star04, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 04 --fundo dxDrawImage(x*star05, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 05 --fundo dxDrawImage(x*star06, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 06 --fundo end if wanted == 4 then dxDrawImage(x*star01, y*altura, x*imageL, y*imageA, image) -- star 01 dxDrawImage(x*star02, y*altura, x*imageL, y*imageA, image) -- star 02 dxDrawImage(x*star03, y*altura, x*imageL, y*imageA, image) -- star 03 dxDrawImage(x*star04, y*altura, x*imageL, y*imageA, image) -- star 04 dxDrawImage(x*star05, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 05 --fundo dxDrawImage(x*star06, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 06 --fundo end if wanted == 5 then dxDrawImage(x*star01, y*altura, x*imageL, y*imageA, image) -- star 01 dxDrawImage(x*star02, y*altura, x*imageL, y*imageA, image) -- star 02 dxDrawImage(x*star03, y*altura, x*imageL, y*imageA, image) -- star 03 dxDrawImage(x*star04, y*altura, x*imageL, y*imageA, image) -- star 04 dxDrawImage(x*star05, y*altura, x*imageL, y*imageA, image) -- star 05 dxDrawImage(x*star06, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 06 --fundo end if wanted == 6 then dxDrawImage(x*star01, y*altura, x*imageL, y*imageA, image) -- star 01 dxDrawImage(x*star02, y*altura, x*imageL, y*imageA, image) -- star 02 dxDrawImage(x*star03, y*altura, x*imageL, y*imageA, image) -- star 03 dxDrawImage(x*star04, y*altura, x*imageL, y*imageA, image) -- star 04 dxDrawImage(x*star05, y*altura, x*imageL, y*imageA, image) -- star 05 dxDrawImage(x*star06, y*altura, x*imageL, y*imageA, image) -- star 06 end end end addEventHandler("onClientHUDRender", root, HudGtaV) function drawHud() draw = true end addEvent("HudGtaV",true) addEventHandler("HudGtaV",root,drawHud) function toggleRadar() if isVisible then addEventHandler("onClientHUDRender", root, HudGtaV) else removeEventHandler("onClientHUDRender", root, HudGtaV) end isVisible = not isVisible end bindKey ("F11", "down", toggleRadar) addEventHandler("onClientResourceStart", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, false) end end ) addEventHandler("onClientResourceStop", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, true) end end ) function dxDrawBorderedText( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI ) dxDrawText ( text, x - 1, y - 1, w - 1, h - 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y - 1, w + 1, h - 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x - 1, y + 1, w - 1, h + 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y + 1, w + 1, h + 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x - 1, y, w - 1, h, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y, w + 1, h, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y - 1, w, h - 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y + 1, w, h + 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI ) end
  6. Walid

    Help Add On

    All what you need is here : wiki page
  7. Walid

    Help Add On

    calm down guys, @koko.m.t.a i already gave you the solution so try to do it by yourself.
  8. Walid

    help plz

    function fanFunction() bindKey ("lshift","down",yourFunction) end addEvent("bindme",true) addEventHandler("bindme",root,fanFunction) function yourFunction() if isPedInVehicle (localPlayer) then local vehicle = getPedOccupiedVehicle (localPlayer) local sx,sy,sz = getElementVelocity ( vehicle ) setElementVelocity( vehicle ,sx, sy, sz+0.5 ) end end
  9. Walid

    Solved

    Sorry i'm using the phone try now -- Set drift score function setDriftScore(anterior1,mejor1,total1) anterior = anterior1 mejor = mejor1 total = total1 end addEvent("setDriftScore", true) addEventHandler("setDriftScore",root,setDriftScore)
  10. i don't know what are yo trying to do. Try something like this local tanks = {} -- tanks table -- Add vehicle to table and apply shader function addToTable(vehicle) if vehicle then local model = getElementModel(vehicle) if tank[model] and not tanks[vehicle] then tanks[vehicle] = true local leftShader = dxCreateShader("replacer.fx", 0, 100, true,"vehicle") local rightShader = dxCreateShader("replacer.fx", 0, 100, true,"vehicle") setElementData(vehicle, "leftShader", leftShader, false) setElementData(vehicle, "rightShader", rightShader, false) engineApplyShaderToWorldTexture(leftShader, "tex1", vehicle) engineApplyShaderToWorldTexture(rightShader, "tex2", vehicle) end end end function checkAndApply() local vehicles = getElementsByType ( "vehicle" ) for i , v in pairs (vehicles) do addToTable(v) end end
  11. Walid

    Solved

    Man show me full code anyways all what you need to is : -- triggerServerEvent to check if the client is ready addEventHandler("onClientResourceStart", resourceRoot, function() triggerServerEvent("getDriftScore",resourceRoot) end ) -- Set drift score function setDriftScore(anterior1,mejor1,total1) anterior = anterior1 mejor = mejor1 total = total1 end addEvent("getDriftScore", true) addEventHandler("getDriftScore",resourceRoot,getDriftScore) -- Get the dirft score function getDriftScore() -- your stored data i don't know you if you are using account Data or MySQL -- Example : local account = getPlayerAccount(client) if account and not isGuestAccount(account) then local anterior = getAccountData (account, "Last Drift") or 0 local mejor = getAccountData (account, "Best Drift") or 0 local total = getAccountData(account, "Total Drift") or 0 triggerClientEvent(client,"setDriftScore",client,anterior,mejor,total) end end addEvent("getDriftScore", true) addEventHandler("getDriftScore",resourceRoot,getDriftScore)
  12. Added the element type to your dxCreateShader function example: dxCreateShader("replacer.fx", 0, 100, true,"vehicle")
  13. Walid

    Solved

    Show me the server side.
  14. Sorry i'm using the phone. function speaker(cmd) if cmd == "start" then sirenSound = playSound3D( 'siren.mp3', 2097.00, -1629.59, 18.79, true ) setSoundVolume(sirenSound,100) elseif cmd == "stop" then if isElement(sirenSound) then stopSound(sirenSound) end end addCommandHandler ( "start", speaker ) addCommandHandler ( "stop", speaker )
  15. Sorry i' using the phone try this: local Cars = {[429] = true} function functionName(player, key,State,vehicle) if (isDrifting == false) then isDrifting = true setVehicleHandling(vehicle, "maxVelocity", 300.0) setVehicleHandling(vehicle, "engineAcceleration", 90.0 ) setVehicleHandling(vehicle, "engineInertia", -999) elseif (isDrifting == true) then isDrifting = false setVehicleHandling(vehicle, "maxVelocity", 300.0) setVehicleHandling(vehicle, "engineAcceleration", 30 ) setVehicleHandling(vehicle, "engineInertia", 5) end end function isDriftingstatus (player,seat) if (Cars[getElementModel(source)]) then if seat == 0 then if eventName == "onVehicleEnter" then bindKey ( player, "lshift", "down", functionName,source) isDrifting == false elseif eventName == "onVehicleExit" then unbindKey (player, "lshift", "down", functionName ) end end end end addEventHandler ( "onVehicleEnter", getRootElement(),isDriftingstatus) addEventHandler ( "onVehicleExit", getRootElement(), isDriftingstatus)
  16. use /debugscript 3 and Try this function showSpawnScreen() if not spawnWindow then drawSpawnScreen() end setElementInterior(localPlayer,0) setElementDimension(localPlayer,0) setSpawnCamera() setTimer(function () fadeCamera(true) guiSetVisible(spawnWindow,true) guiSetVisible(infoMemo,true) guiSetVisible(locationGridList,false) guiGridListSetSelectedItem(classGridList,-1,0) showCursor(true) end,2000,1) end function deathMode() if deathscreen then deathscreen = guiCreateWindow(0.3,0.8,0.4,0.2,"SPAWN SCRREN",true) guiWindowSetSizable(deathscreen,false) death_hospital = guiCreateButton(0.0332,0.5463,0.4688,0.3659,"Hospital (1000$) \n You'll keep your weapons",true,deathscreen) death_spawn = guiCreateButton(0.5156,0.5463,0.4531,0.3659,"SPAWNSCREEN",true,deathscreen) deathbar = guiCreateProgressBar(0.0391,0.2732,0.9121,0.1902,true,deathscreen) deathlabel = guiCreateLabel(0.1094,0.1415,0.7754,0.1073,"... WAITING FOR REANIMATION ...",true,deathscreen) guiLabelSetVerticalAlign(deathlabel,"center") guiLabelSetHorizontalAlign(deathlabel,"center",false) addEventHandler("onClientGUIClick",death_hospital,spawnAtHospital) addEventHandler("onClientGUIClick",death_spawn,normalSpawnWindow) end guiProgressBarSetProgress(deathbar,100) guiSetVisible(deathscreen, true) showCursor(true) fadeCamera(true) deathTimer = setTimer(countUntilDeath, 1000, 1, 50) end addEvent("spawnhotpital.showDeathScreen",true) addEventHandler("spawnhotpital.showDeathScreen",localPlayer,deathMode) function countUntilDeath(time) if getElementData(getLocalPlayer(),"reanimation") then reanimatePlayer() setElementData(getLocalPlayer(),"reanimationtime",false) deathTimer = nil else if time > 0 then time = time -1 guiProgressBarSetProgress(deathbar,time * 2) deathTimer = setTimer(countUntilDeath, 1000, 1, time) else setElementData(getLocalPlayer(),"reanimationtime",false) deathTimer = nil normalSpawnWindow() end end end function normalSpawnWindow() if deathTimer then killTimer(deathTimer) deathTimer = nil end guiSetVisible(deathscreen, false) setElementData(getLocalPlayer(), "class", "N/A") showSpawnScreen() tempweapons = {} end function spawnAtHospital() if source == death_hospital then if ((getTeamName(getPlayerTeam(getLocalPlayer())) == "Criminals")or(getTeamName(getPlayerTeam(getLocalPlayer())) == "RvB Blue")) then triggerEvent("newMessage",root,nil,getLocalPlayer(),"*HELP* You can't use hospital while using RvB teams","call",255, 100, 50) return end if getPlayerMoney(getLocalPlayer()) >= 1000 then if deathTimer then killTimer(deathTimer) deathTimer = nil end guiSetVisible(deathscreen, false) showCursor(false) triggerServerEvent("SPAWNATHOSIPTAL", getLocalPlayer(), tempweapons) tempweapons = {} exports.RPGcommands:takeMoney(getLocalPlayer(),1000) else outputChatBox("You need 1000$ to spawn at a Hospital", 255, 100, 0) end end end function reanimatePlayer() local Dim = getElementDimension(getLocalPlayer()) local Int = getElementInterior(getLocalPlayer()) if deathTimer then killTimer(deathTimer) deathTimer = nil end guiSetVisible(deathscreen, false) showCursor(false) triggerServerEvent("REANIMATEPLAYER", getLocalPlayer(), tempweapons, Dim, Int) tempweapons = {} end function weaponsAfterDeath() if source == getLocalPlayer() then tempweapons = {} local weaponSlots = {0,1,2,3,4,5,6,7,8,9,10,11,12} for i, slot in ipairs(weaponSlots) do local ammo = getPedTotalAmmo ( getLocalPlayer(), slot ) if ( getPedWeapon ( getLocalPlayer(), slot ) ~= 0 ) then local weapon = getPedWeapon ( getLocalPlayer(), slot ) local ammo = getPedTotalAmmo ( getLocalPlayer(), slot ) table.insert(tempweapons, {weapon, ammo}) end end end end addEventHandler("onClientPlayerWasted", getRootElement(), weaponsAfterDeath) function waterCheck() if isElementInWater(localPlayer) then local px,py,pz = getElementPosition(localPlayer) local wx,wy,wz = getWaterLevel(x,y,z) setElementPostion(localPlayer,px,py,wz+3) end end addEventHandler("onClientPlayerSpawn",root,waterCheck)
  17. Use /debugscript 3 and try this function startCopJob (player) if player and isElement(player) then local team = getPlayerTeam(player) if team then if (getTeamName(team)== "LSPD") then setElementModel(player, 280) outputChatBox("Вы начали рабочий день!", player, 0,191,255) else outputChatBox("Вы не сотрудник LSPD!", player, 0,191,255) end end end end addEventHandler ( "onPickupHit", coppickup, startCopJob )
  18. its function not Function anyways try this: function criminalTeam () criminal = createTeam("Criminals", 200, 0, 0) end addEventHandler("onResourceStart", resourceRoot, criminalTeam) function joincrim(player) if player and isElement(player) then if (criminal) then setPlayerTeam (player,criminal) outputChatBox ("You Are Now A Criminal",player,0,255,0) end end end addCommandHandler (criminal,joincrim)
  19. Walid

    Help

    i will give you some examples: 1) triggerEvent( "eventName", root) -- source is root 2) triggerEvent( "eventName", thePlayer ) -- source is thePlayer 3) triggerEvent( "eventName", resourceRoot) -- source is resourceRoot of the calling resource 4) triggerEvent( "eventName", theVehicle) -- source is theVehicle
  20. Use triggerServerEvent check if the player is logged in then send the information to the client side. Example: Client side: triggerServerEvent("isClientReady",resourceRoot) Server side: function isReady() if isPlayerLoggedIn(client) then triggerClientEvent(client,"eventName",client) end end addEvent("isClientReady",true) addEventHandler("isClientReady",resourceRoot,isReady) -- Check if the player is logged In function isPlayerLoggedIn(player) if (not isElement(player) or getElementType(player) ~= "player") then return false end local account = getPlayerAccount(player) if (isGuestAccount(account)) then return false end return true end
  21. You need to add the arg here: Try this : function addVIP (playerSource, commandName, accountName, type) if player and isElement(player) then if accountName then aclGroupAddObject (aclGetGroup("VIP"), "user."..accountName) outputChatBox ("Account '"..accountName.."' has been succesfully made VIP (3 Weeks)", playerSource) setTimer(removeVIP, 1000, 1,accountName) else outputChatBox ("No account name specified.", playerSource) outputChatBox ("Correct syntax: /giveVIP [Account Name]", playerSource) end end end addCommandHandler ("giveVIP", addVIP) function removeVIP (accountName) if accountName then aclGroupRemoveObject (aclGetGroup("VIP"), "user."..accountName) outputServerLog("Account "..accountName.."'s VIP expired.") end end
×
×
  • Create New...