-
Posts
636 -
Joined
-
Last visited
-
Days Won
6
Everything posted by HassoN
-
To sprint with heavy weapons use: setPedWalkingStyle -- with MOVE_BLINDMAN 127 or MOVE_SNEAK 69
-
your 'h' is not defined.
-
اول كود لازم تتحقق انه فيه قاتل ولالا استعمل isElement -- تتحقق ان الي قتله موجود getElementType -- تتحقق انه لاعب الي قتله root وبرضو اول لوكال بلاير داخل الايفنت خليها source بـ localPlayer ثاني كود جرب تستبدل الكود الثالث ، ضيف تحقق يجيب لاعب الشخص واذا كان شرطي يسوي كنسل onPlayerMarkerHit getPlayerTeam getTeamName رابع كود ماله دخل بالميتا ، اعرض اكواد المود نفسه .. استعمل onPlayerTarget setPlayerWantedLevel مود الي يحفظ لك العضلاات والحاجات ذي بتلاقيها منشورة ، دور وبتلاقي
-
Useful functions
- 16 replies
-
- 2
-
-
-
- userful
- useful funnctions
-
(and 2 more)
Tagged with:
-
There is no team chat script. You have to modify it yourself. Use: onPlayerChat cancelEvent -- then output your own message.
-
I tried this by myself and it's working. -- client local drawDistance = 15 g_StreamedInPlayers = {} function onClientRender() local cx, cy, cz, lx, ly, lz = getCameraMatrix() for k, player in ipairs(g_StreamedInPlayers) do if isElement(player) and isElementStreamedIn(player) then do local vx, vy, vz = getPedBonePosition(player, 8) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if getElementData(player, "invisiblePlayer") then return false end if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3) if x and y then local name = getPlayerName(player) local id = getElementData ( player, "ID", s_id ) or "0" local w = dxGetTextWidth(name, 1, "default-bold") local h = dxGetFontHeight(1, "default-bold") local fname = getElementData(player,"fname") or getPlayerName(player) local sname = getElementData(player,"sname") or "S" local hp = getElementData(player,"lastDamage") or "100" dxDrawText("#FFFFFF"..fname.." "..sname.."#1E90FF ["..id.."]", x - 2 - w / 4, y - 0 - h - 12, w, h, tocolor(255, 0, 0), 1, "default-bold","left","top",false,false,false,true) local health = getElementHealth(player) local armour = getPedArmor(player) if health > 0 then local rate = 500 / getPedStat(player, 24) drawHPBar(x, y - 6, health * rate, dist) if armour > 0 then drawArmourBar(x, y - 12, armour, dist) end end end end end else table.remove(g_StreamedInPlayers, k) end end end addEventHandler("onClientRender", root, onClientRender) function onClientElementStreamIn() if getElementType(source) == "player" and source ~= getLocalPlayer() then setPlayerNametagShowing(source, false) table.insert(g_StreamedInPlayers, source) end end addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn) function onClientResourceStart(startedResource) visibleTick = getTickCount() counter = 0 normalhealthbar = false local players = getElementsByType("player") for k, v in ipairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart) -- server function toggleInvis( source ) if getElementAlpha(source) == 255 then setElementAlpha(source, 0) setElementData(source, "invisiblePlayer", true) else setElementAlpha(source, 255) setElementData(source, "invisiblePlayer", nil) end end addCommandHandler ( "invisible", toggleInvis ) The code is a huge mess tho, you could order it a little bit more.
-
Try this local drawDistance = 15 g_StreamedInPlayers = {} local blockedPlayers = {} function onClientRender() local cx, cy, cz, lx, ly, lz = getCameraMatrix() for k, player in ipairs(g_StreamedInPlayers) do if isElement(player) and isElementStreamedIn(player) then do local vx, vy, vz = getPedBonePosition(player, 8) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if blockedPlayers[player] then return false end if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3) if x and y then local name = getPlayerName(player) local id = getElementData ( player, "ID", s_id ) local w = dxGetTextWidth(name, 1, "default-bold") local h = dxGetFontHeight(1, "default-bold") local fname = getElementData(player,"fname") local sname = getElementData(player,"sname") local hp = getElementData(player,"lastDamage") dxDrawText("#FFFFFF"..fname.." "..sname.."#1E90FF ["..id.."]", x - 2 - w / 4, y - 0 - h - 12, w, h, tocolor(255, 0, 0), 1, "default-bold","left","top",false,false,false,true) local health = getElementHealth(player) local armour = getPedArmor(player) if health > 0 then local rate = 500 / getPedStat(player, 24) drawHPBar(x, y - 6, health * rate, dist) if armour > 0 then drawArmourBar(x, y - 12, armour, dist) end end end end end else table.remove(g_StreamedInPlayers, k) end end end addEventHandler("onClientRender", root, onClientRender) function invis() blockedPlayers[source] = true end addEvent( "invis", true ) addEventHandler( "invis", root, invis ) function invisoff() blockedPlayers[source] = nil end addEvent( "invisoff", true ) addEventHandler( "invisoff", root, invisoff) function onClientElementStreamIn() if getElementType(source) == "player" and source ~= getLocalPlayer() then setPlayerNametagShowing(source, false) table.insert(g_StreamedInPlayers, source) end end addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn) function onClientResourceStart(startedResource) visibleTick = getTickCount() counter = 0 normalhealthbar = false local players = getElementsByType("player") for k, v in ipairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart) -- server iv = 0 function toggleInvis( source ) if iv == 0 then iv = 1 setElementAlpha(source, 0) triggerClientEvent(source, "invis", source) else iv = 0 setElementAlpha(source, 255) triggerClientEvent(source, "invisoff", source) end end addCommandHandler ( "invisible", toggleInvis ) btw you should use ipairs with tables that have numbers as index. (I modified it for you)
-
This should work. -- client local drawDistance = 15 g_StreamedInPlayers = {} function onClientRender() local cx, cy, cz, lx, ly, lz = getCameraMatrix() for k, player in pairs(g_StreamedInPlayers) do if isElement(player) and isElementStreamedIn(player) then do local vx, vy, vz = getPedBonePosition(player, 8) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3) if x and y then local name = getPlayerName(player) local id = getElementData ( player, "ID", s_id ) local w = dxGetTextWidth(name, 1, "default-bold") local h = dxGetFontHeight(1, "default-bold") local fname = getElementData(player,"fname") local sname = getElementData(player,"sname") local hp = getElementData(player,"lastDamage") dxDrawText("#FFFFFF"..fname.." "..sname.."#1E90FF ["..id.."]", x - 2 - w / 4, y - 0 - h - 12, w, h, tocolor(255, 0, 0), 1, "default-bold","left","top",false,false,false,true) local health = getElementHealth(player) local armour = getPedArmor(player) if health > 0 then local rate = 500 / getPedStat(player, 24) drawHPBar(x, y - 6, health * rate, dist) if armour > 0 then drawArmourBar(x, y - 12, armour, dist) end end end end end else table.remove(g_StreamedInPlayers, k) end end end addEventHandler("onClientRender", root, onClientRender) function invis() for k, player in pairs(g_StreamedInPlayers) do if player == source then table.remove(g_StreamedInPlayers, k) end end end addEvent( "invis", true ) addEventHandler( "invis", root, invis ) function invisoff() table.insert(g_StreamedInPlayers, source) end addEvent( "invisoff", true ) addEventHandler( "invisoff", root, invisoff) function onClientElementStreamIn() if getElementType(source) == "player" and source ~= getLocalPlayer() then setPlayerNametagShowing(source, false) table.insert(g_StreamedInPlayers, source) end end addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn) function onClientResourceStart(startedResource) visibleTick = getTickCount() counter = 0 normalhealthbar = false local players = getElementsByType("player") for k, v in pairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart) -- server iv = 0 function toggleInvis( source ) if iv == 0 then iv = 1 setElementAlpha(source, 0) triggerClientEvent(source, "invis", source) else iv = 0 setElementAlpha(source, 255) triggerClientEvent(source, "invisoff", source) end end addCommandHandler ( "invisible", toggleInvis )
-
Try this addCommandHandler("giveitem", function(playerSource, cmd, id, item, value, count) local level = getElementData( playerSource, "adminlevel" ) or 0 if level >= 6 then if (getElementData (playerSource, "adminduty") or 0) == 1 then if id and item and value and count then local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(playerSource, id) if targetPlayer then if giveItem(targetPlayer, tonumber(item), tonumber(value), tonumber(count), 0, true) then -- 0 -> dutyitem local comy = getElementData(playerSource, "anick") outputChatBox("#7cc576[Információ]: #ffffffKaptál #00AEFF".. comy .."#FFFFFF-tól/től egy #D75555" ..getItemName(tonumber(item)).." #ffffffitemet.", targetPlayer,255,255,255,true) outputChatBox("#7CC576[#7CC576wls#ffffffMTA #ffffff- #53bfdcAdmin információ#7CC576]: #00AEFF".. targetPlayerName:gsub("_", " ") .."#FFFFFF-nak/nek adtál egy #D75555" ..getItemName(tonumber(item)).." #ffffffitemet.", playerSource,255,255,255,true) exports.global:sendMessageToAdmins("#7CC576[#7CC576wls#ffffffMTA #ffffff- #53bfdcAdminnapló#7CC576]#ffffff: #00AEFF" .. comy .. " #FFFFFFadott #00AEFF".. targetPlayerName:gsub("_", " ") .."#ffffff-nak/nek egy #D75555" ..getItemName(tonumber(item)).."#ffffff nevezetű itemet.", 255, 0, 0,true) exports.logs:logMessage("[addolás] ".. comy .. " adott ".. targetPlayerName:gsub("_", " ") .."-nak/nek egy " ..getItemName(tonumber(item)).." nevezetű itemet.", 34) else outputChatBox("#7CC576[#7CC576wls#ffffffMTA #ffffff- #53bfdcAdmin információ#7CC576]: #ffffffNem fér el több tárgy az adott játékosnál!", playerSource, 255 ,255, 255, true) end end else outputChatBox("#7cc576[Használat]: #ffffff/"..cmd.." [Név / ID] [ItemId] [Érték] [Db]", playerSource, 255, 255, 255, true) end else outputChatBox("#d24d57[WLS - Defend]: #FFFFFFNem vagy adminszolgálatba!", playerSource,255,255,255,true) end end end )
-
?الحمدلله اني قدرت اساعدك ، حياك الله
-
سوي ريستارت للسيرفر بعد ما حدثت الاسل وشغل المود وان شاء الله بيضبط ، لو ماضبط اطرح الاسل حقك ?
-
This should do the trick. -- server addEventHandler("onPlayerSpawn", root, function() triggerClientEvent("sendOrder", source) end) -- client function removeSound() setPedVoice(source, "PED_TYPE_DISABLED", "nil") end addEvent("sendOrder", true) addEventHandler("sendOrder", root, removeSound)
-
You can't force players to change their game's default settings.
-
I thought you were talking about modifying the value of a setting in meta.xml. I've checked the voice resource and yea apparently it's not possible to change the key.
-
حسب الي شايفه ، اعتقد الكود مافيه مشكلة ، اذا جيت تسجل يكتب لك تم التسجيل بنجاح؟ ولا مايكتب شي؟ اذا يكتب ، المشكلة اكيد من البرمشنز ، تاكد انه بقروب ادمن وتاكد ان قروب ادمن ذا معه صلاحية يسوي حساب (ممكن انت شايل الخاصية ذي من قروب ادمن)ء واذا مايكتب لك تم التسجيل بنجاح يعني فيه مشكلة بالكود ولازم يكتب لك شي بالدي بق
-
debugscript وريني الكود الي يضيف حسابات + جيب رسالة ال
-
ضيف المود لقروب ادمن من خلال الاسل
-
العفو حياك الله
-
سطر 322 بتلاقي كود setCameraMatrix(65.13557, 1640.16272, 46.53631) ضيف بعده status = true سطر 587 بتلاقي كود showPlayerHudComponent("all", true) ضيف بعده status = false
-
الحل انك ، شفت اول صورة رسلتها فوق؟ فيه لوحتين صح؟ روح دور ع الكود حقهم الي يسوي guiSetVisible وروح حط تحته status = true وبعدها دور مرة ثانية ع الكود الي يخفي اللوحتين وحط بعدها status = false ولاتنسا تشيل اول سطر من الكود الي انا ححاطه لك ، وبيضبط ان شاء الله
-
Are you creating it with the admin panel? if so then use a separated code. createTeam
-
No. Basically it should be something like this: -- meta.xml <settings> <setting name="keyBind" value="X" /> </settings> -- Server side set("keyBind", "Z") Main value is "X" as you specified in the meta. but in the server side you are changing it to Z.