Jump to content

Walid

Members
  • Posts

    1,491
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Walid

  1. Ryan code is correct just if you want to trigger the function from the server side , so you need to add the timer inside the function . function timedFunc(arg) -- rest of function... timer = setTimer(timedFunc,60000, 0) -- 1 munite end addEvent("checkTimer",true) addEventHandler("checkTimer",root,timedFunc) -- Function to kill the timer function otherFunc(arg) if isTimer (timer) then killTimer(timer) -- It will delete timer since the timer is a global value attached with upper function. end end
  2. Don't work If use root then the localPlayer and another Player the same texture You must add something like this in your client side : if player == localPlayer then end
  3. Walid

    HUD

    Man read my reply just use onClientHUDRender() Read this : Game Processing Order
  4. Walid

    ammo

    show me your code
  5. Walid

    HUD

    Guys what are u talking about it's a custom HUD he can't use showPlayerHudComponent(). just try to use onClientHUDRender() removeEventHandler()
  6. Walid

    ammo

    Shared function
  7. just use this triggerClientEvent(root, 'addClothes',root, source, 'tshirtblack', 'cj_ped_torso')
  8. -- you can use it in map file createObject() -- it's a function so try to use tables if you want to create many objects. exmaple: local objects = { -- Object coordination here : model , x , y , z , rx , ry , rz } for i , v in pairs (objects) do -- You code here end
  9. Walid

    ammo

    try to use getPedWeapons() function getPedWeapons(ped) local playerWeapons = {} if ped and isElement(ped) and getElementType(ped) == "ped" or getElementType(ped) == "player" then for i=2,9 do local wep = getPedWeapon(ped,i) if wep and wep ~= 0 then table.insert(playerWeapons,wep) end end else return false end return playerWeapons end
  10. crashed ??? show me your debugscript
  11. Yes ofc you can all what you need to do is adding your old db details (username , password etc ...) inside the new resources .
  12. U can use : setVehicleColor() -- Shared function Example: local r , g , b = 255,0,0 -- Red color setVehicleColor(veh, r , g , b , r , g , b )
  13. ??? what are you talking about.
  14. Try this i didn't test it. local thirdMarker = false local MarkersTable = {} local Markers = { {1213.9326171875, -1340.8984375, 13.571063995361}, -- Marker 1 {1214.1376953125, -1309.7197265625, 13.557456016541}, -- Marker 2 {1214.1376953125, -1309.7197265625, 13.557456016541,true}, -- Marker 3 } function CreateMarkers() for i=1,#Markers do local x, y, z = Markers[i][1], Markers[i][2], Markers[i][3] local theMarker = createMarker ( x, y, z , "cylinder", 2, 255, 0, 0, 150) table.insert (MarkersTable, theMarker ) if Markers[i][4] then thirdMarker = true end addEventHandler ( "onClientMarkerHit", theMarker, MarkersEvent, false ) end end addEventHandler("onClientResourceStart",resourceRoot,CreateMarkers) function MarkersEvent (thePlayer,matchDim) if matchDim and thePlayer == getLocalPlayer() then if isThirdMarker ( source ) then for i , v in ipairs(MarkersTable) do destroyElement(v) CreateMarkers() -- then the code starts again from the beginning. end else destroyElement(source) end end end function isThirdMarker ( theMarker ) for i, v in ipairs (MarkersTable) do if ( v == theMarker ) and thirdMarker then return true end end return false end
  15. No one will help you with a leaked script.
  16. ok try this : -- Client side addEvent ("onCreateUzi",true) function createUzi (vehicle,px,py,pz) uzi = createWeapon("uzi", px,py,pz) setWeaponClipAmmo(uzi, 99999) attachElementToElement(uzi,vehicle, 0, 1.2, 0, 0, 0, 90) end addEventHandler ("onCreateUzi", root, createUzi) function fire_uzi (state) local weapon_state = tostring(state) setWeaponState(uzi, weapon_state) end addEvent ("uzi_state",true) addEventHandler ("uzi_state", root, fire_uzi) -- Server side function createBatPod(thePlayer, command) local pX,pY,pZ = getElementPosition(thePlayer) local _,_,rot = getElementRotation (thePlayer) local Batpod = createVehicle (522, pX,pY,pZ) if (Batpod) then warpPedIntoVehicle (thePlayer, Batpod) triggerClientEvent(root, "onCreateUzi", root,Batpod,pX,pY,pZ) bindKey(thePlayer, "vehicle_fire", "both", fire_uzi) end end addCommandHandler ("batpod", createBatPod) function fire_uzi(thePlayer, key, keyState) if (keyState == "down") then weapon_state = "firing" triggerClientEvent(thePlayer, "uzi_state", getRootElement(),weapon_state) elseif (keyState == "up") then weapon_state = "ready" triggerClientEvent(thePlayer, "uzi_state", getRootElement(),weapon_state) end end
  17. post full code here
  18. lol you can't use CreateWeapon() funtion server side. try to use this : triggerClientEvent(root, "onCreateUzi", root,pX,pY,pZ)
  19. You can't write it like this because getPlayerAccount() it's a server side function so all what you need is : triggerClientEvent() example : -- Server side function replace (player) if not isElement(player) then return end local account = getPlayerAccount (player) if not isGuestAccount ( account ) then local accName = getAccountName(account) if accName == " YOUR ACCOUNT NAME " then triggerClientEvent(player,"Replace",player) else outputChatBox ("sorry you can use this command!",player,255,0,0) end end addCommandHandler("vehskin" ,replace) -- Client side function replace () txd = engineLoadTXD ( "infernus.txd" ) engineImportTXD ( txd, 411) end addEvent("Replace",true) addEventHandler("Replace",root,replace)
  20. You can use this one : addEventHandler ( "onResourceStart", root, function ( ) for _,weaponSkill in ipairs({"poor","std","pro"}) do setWeaponProperty("minigun", weaponSkill, "weapon_range", 75) setWeaponProperty("minigun", weaponSkill, "target_range", 50) setWeaponProperty("minigun", weaponSkill, "accuracy", 5) setWeaponProperty("minigun", weaponSkill, "damage", 5) setWeaponProperty("minigun", weaponSkill, "maximum_clip_ammo", 100) end end )
  21. Walid

    afk script

    it's very simple just try to use your imagination : setTimer() getPlayerIdleTime() -- check if the player idle time > 30 seconds then ..... setElementDimension() -- change the player dimension setElementFrozen() bindKey() unbindKey() etc ...
  22. Walid

    afk script

    why you need to use onClientCursorMove , try to use : getPlayerIdleTime()
  23. Walid

    On playSound

    Maybe you can put somthing like that in your meta file "song" download="false" />
  24. You can use this guiEditSetMasked(, true) Edit : Sorry i didn't see xTravax post.
×
×
  • Create New...