-
Posts
1,491 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Walid
-
change (playersource;theplayer) to spurceplayer. Code: function bless (spurceplayer) if isElement (spurceplayer) then local account = getPlayerAccount(spurceplayer) if ( not account or isGuestAccount ( account ) ) then return end if isObjectInACLGroup("user." .. getAccountName(account), aclGetGroup("Admin")) then for id, player in ipairs(getElementsByType("player")) do setElementData(player,"blood", 12000) setElementData(player,"bleeding", 0) setElementData(player,"cold", false) setElementData(player,"temperature", 37) setElementData(player,"pain", false) setElementData(player,"brokenbone", false) setElementData(player,"thirst", 100) setElementData(player,"food", 100) end outputChatBox("#6495ED[DVOORN]#C0C0C0All players were cured.!", spurceplayer, 255, 255, 255, true) end end end addCommandHandler("aheall", bless)
-
try this : function onPlayerSpawnHandler () local account = getPlayerAccount ( source ) if ( not account or isGuestAccount ( account ) ) then return end if ( isObjectInACLGroup ( "user." .. getAccountName (account) , aclGetGroup ( "VIP" ) ) ) then setPedArmor ( source, 100 ) end end addEventHandler( "onPlayerSpawn", root, onPlayerSpawnHandler )
-
In this way? addEvent('addClothes', true) function addClothes(player, clothesTexture, clothesModel) local cType = cClothes[clothesModel] local clothe = cType[clothesTexture] if (player == localPlayer) then if (Shader) then dxSetShaderValue(Shader, 'gTexture', clothe.model) engineApplyShaderToWorldTexture(Shader, clothesModel, player) end end end addEventHandler('addClothes', root, addClothes) yes
-
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
-
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
-
Man read my reply just use onClientHUDRender() Read this : Game Processing Order
-
Guys what are u talking about it's a custom HUD he can't use showPlayerHudComponent(). just try to use onClientHUDRender() removeEventHandler()
-
just use this triggerClientEvent(root, 'addClothes',root, source, 'tshirtblack', 'cj_ped_torso')
-
-- 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
-
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
-
crashed ??? show me your debugscript
-
Yes ofc you can all what you need to do is adding your old db details (username , password etc ...) inside the new resources .
-
U can use : setVehicleColor() -- Shared function Example: local r , g , b = 255,0,0 -- Red color setVehicleColor(veh, r , g , b , r , g , b )
-
??? what are you talking about.
-
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
-
No one will help you with a leaked script.
-
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
-
lol you can't use CreateWeapon() funtion server side. try to use this : triggerClientEvent(root, "onCreateUzi", root,pX,pY,pZ)
-
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)
-
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 )
-
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 ...