Jump to content

ZeyadGTX

Members
  • Posts

    451
  • Joined

  • Last visited

Everything posted by ZeyadGTX

  1. ZeyadGTX

    Armor

    That's dxDrawText Functions Client Side FPSLimit = 60 FPSMax = 1 player = getLocalPlayer() sWidth,sHeight = guiGetScreenSize() addEvent("onClientPlayerHUDShown", true) addEvent("onClientPlayerHUDHidden", true) function restoreHUD() setElementData(player, "state.hud", "enabled") showChat(true) showPlayerHudComponent("crosshair", true) showPlayerHudComponent("radar", true) triggerServerEvent("onPlayerHUDShown", player) triggerEvent("onClientPlayerHUDShown", player) end addEventHandler("onClientResourceStart", resourceRoot, restoreHUD) function hudvisible ( ) if getElementData(player, "state.hud") == "disabled" then return end --Gets some elements local hour, mins = getTime () local time = hour .. ":" .. (((mins < 10) and "0"..mins) or mins) local moneycount=getPlayerMoney(getLocalPlayer()) local money= '' ..moneycount local phealth = math.floor (getElementHealth ( getLocalPlayer() )) local armor = math.floor(getPedArmor ( getLocalPlayer() )) local zone = getZoneName (getElementPosition(getLocalPlayer())) local oxygen = getPedOxygenLevel (getLocalPlayer()) local ammo = getPedTotalAmmo (getLocalPlayer()) local clip = getPedAmmoInClip (getLocalPlayer()) local XP = getElementData(localPlayer, "EXP") or 0 local LV = getElementData(localPlayer, "LV") or 0 local lp = getElementData(player, "Army.rank") or "Newbie" --Draws the player hud dxDrawText(tostring (time),(0.878)*sWidth, (0.007)*sHeight, (0.293)*sWidth, (0.263)*sHeight,tocolor(250,250,250,200),(0.9/1366)*sWidth,(0.9/768)*sHeight,"bankgothic","left","top",false,false,false,true) dxDrawText(tostring (money), (0.08)*sWidth, (0.640)*sHeight, (0.282)*sWidth, (0.326)*sHeight, tocolor (0, 255, 0, 255), (0.9/1366)*sWidth,(0.9/768)*sHeight,"bankgothic","left","top",false,false,false,true) dxDrawText("#FFFFFFHealth: #FF0000"..phealth.."%", (870/1024)*sWidth, (45/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (0, 0, 0, 255), (0.9/1366)*sWidth,(0.9/768)*sHeight,"bankgothic","left","top",false,false,false,true) dxDrawText("#FFFFFFArmor: #0000FF"..armor.."%", (872/1024)*sWidth, (80/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (0, 0, 0, 255), (0.99/1366)*sWidth,(0.9/768)*sHeight,"bankgothic","left","top",false,false,false,true) dxDrawText(zone, (850/1024)*sWidth, (740/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (255, 255, 255, 255), (0.85/1366)*sWidth,(0.85/768)*sHeight,"bankgothic","left","top",false,false,false,true) --dxDrawText(tonumber(getElementData(getLocalPlayer(), "distance.foot")).." m", (25/1024)*sWidth, (200/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (255, 255, 255, 255), (0.7/1366)*sWidth,(0.7/768)*sHeight,"bankgothic","left","top",false,false,false,true) --dxDrawText(tonumber(getElementData(getLocalPlayer(), "distance.Automobile")).." m", (25/1024)*sWidth, (215/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (255, 255, 255, 255), (0.7/1366)*sWidth,(0.7/768)*sHeight,"bankgothic","left","top",false,false,false,true) --dxDrawText(tonumber(getElementData(getLocalPlayer(), "distance.Plane")).." m", (25/1024)*sWidth, (230/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (255, 255, 255, 255), (0.7/1366)*sWidth,(0.7/768)*sHeight,"bankgothic","left","top",false,false,false,true) --dxDrawText(tonumber(getElementData(getLocalPlayer(), "distance.Bike")).." m", (25/1024)*sWidth, (245/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (255, 255, 255, 255), (0.7/1366)*sWidth,(0.7/768)*sHeight,"bankgothic","left","top",false,false,false,true) --dxDrawText(tonumber(getElementData(getLocalPlayer(), "distance.Helicopter")).." m", (25/1024)*sWidth, (260/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (255, 255, 255, 255), (0.7/1366)*sWidth,(0.7/768)*sHeight,"bankgothic","left","top",false,false,false,true) --dxDrawText(tonumber(getElementData(getLocalPlayer(), "distance.BMX")).." m", (25/1024)*sWidth, (275/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (255, 255, 255, 255), (0.7/1366)*sWidth,(0.7/768)*sHeight,"bankgothic","left","top",false,false,false,true) --dxDrawText(tonumber(getElementData(getLocalPlayer(), "distance.Quad")).." m", (25/1024)*sWidth, (290/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (255, 255, 255, 255), (0.7/1366)*sWidth,(0.7/768)*sHeight,"bankgothic","left","top",false,false,false,true) dxDrawImage((839/1024)*sWidth, (42/768)*sHeight, (33/1024)*sWidth, (33/768)*sHeight, "Heart.png") dxDrawImage((840/1024)*sWidth, (80/768)*sHeight, (32/1024)*sWidth, (32/768)*sHeight, "armor.png") dxDrawImage((47/1024)*sWidth, (490/768)*sHeight, (32/1024)*sWidth, (32/768)*sHeight, "$.png")
  2. ZeyadGTX

    Armor

    No not working the Whole Armor text is removed if there is armor or there isnot
  3. ZeyadGTX

    Armor

    This Shows player's armor when he has ? and hide when he hasnot ???
  4. ZeyadGTX

    Armor

    Hello i use this Line to Show the player armor in the Hud it works but i want if player have armor then it shown if player doesn't have armor then it should be hidden dxDrawText("#FFFFFFArmor: #0000FF"..armor.."%", (872/1024)*sWidth, (80/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (0, 0, 0, 255), (0.99/1366)*sWidth,(0.9/768)*sHeight,"bankgothic","left","top",false,false,false,true)
  5. ZeyadGTX

    Givemoney

    My Code is : function giveSomeoneMoney(player, cmd, target, amount) if target then if amount then local money = getPlayerMoney(player) local targetplayer = getPlayerFromParticalName(target) local r,g,b = getPlayerNametagColor(player) amount = tonumber(amount) if targetplayer then if money >= amount then givePlayerMoney(targetplayer, amount) takePlayerMoney(player, amount) outputChatBox("You Were Given #00FF00$"..tostring(amount).." #006400 From #FF0000"..getPlayerName(player) , targetplayer, 0, 100, 0, true) outputChatBox("You Gave #00FF00$"..tostring(amount).."#006400 To #FF0000"..getPlayerName(targetplayer), player, 0, 100, 0, true) else outputChatBox("You Don't Have Enough Money !", player, 255, 0, 0) end else outputChatBox("", player, 255, 0, 0) end else outputChatBox("", player, 255, 0, 0) end else outputChatBox("", player, 255, 0, 0) end end addCommandHandler("givemoney", giveSomeoneMoney) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end
  6. ZeyadGTX

    Freeroam

    my sv side @ setPedFightingStyle = { option = 'style', descr = 'Setting fighting style' },
  7. ZeyadGTX

    Givemoney

    SCRIPT ERROR: (Sroam)Givemoney\script.lua:39: 'end' expected (to close 'if' at line 5) near '' [2014-09-16 06:58:33] ERROR: Loading script failed: (Sroam)Givemoney\script.lua:39: 'end' expected (to close 'if' at line 5) near ''
  8. ZeyadGTX

    Givemoney

    ERROR: Loading script failed: (Sroam)Givemoney\script.lua:39: 'end' expected (to close 'if' at line 5) near ''
  9. ZeyadGTX

    Givemoney

    Lot of errors (Sroam)Givemoney\script.lua:35: 'end' expected (to close 'if' at line 6) near '' [2014-09-16 06:20:04] ERROR: Loading script failed: (Sroam)Givemoney\script.lua:35: 'end' expected (to close 'if' at line 6) near ''
  10. ZeyadGTX

    Givemoney

    I got problem Givemoney\script.lua:19: unfinished string near '"You Don't Have Enough Money ! , player, 255, 0, 0)' [2014-09-16 05:56:15] ERROR: Loading script failed: (Sroam)Givemoney\script.lua:19: unfinished string near '"You Don't Have Enough Money ! , player, 255, 0, 0)'
  11. ZeyadGTX

    Freeroam

    not working look my whole fr_client CONTROL_MARGIN_RIGHT = 5 LINE_MARGIN = 5 LINE_HEIGHT = 16 g_Root = getRootElement() g_ResRoot = getResourceRootElement(getThisResource()) g_Me = getLocalPlayer() server = createServerCallInterface() guiSetInputMode("no_binds_when_editing") --------------------------- -- Set skin window --------------------------- function skinInit() setControlNumber(wndSkin, 'skinid', getElementModel(g_Me)) end function showSkinID(leaf) if leaf.id then setControlNumber(wndSkin, 'skinid', leaf.id) end end function applySkin() local skinID = getControlNumber(wndSkin, 'skinid') if skinID then server.setMySkin(skinID) fadeCamera(true) end end wndSkin = { 'wnd', text = 'Set skin', width = 250, x = -20, y = 0.3, controls = { { 'lst', id='skinlist', width=230, height=290, columns={ {text='Skin', attr='name'} }, rows={xml='skins.xml', attrs={'id', 'name'}}, onitemclick=showSkinID, onitemdoubleclick=applySkin }, {'txt', id='skinid', text='', width=50}, {'btn', id='set', onclick=applySkin}, {'btn', id='close', closeswindow=true} }, oncreate = skinInit } function setSkinCommand(cmd, skin) skin = skin and tonumber(skin) if skin then server.setMySkin(skin) fadeCamera(true) closeWindow(wndSpawnMap) closeWindow(wndSetPos) end end addCommandHandler('setskin', setSkinCommand) addCommandHandler('ss', setSkinCommand) --------------------------- --- Set animation window --------------------------- function applyAnimation(leaf) if type(leaf) ~= 'table' then leaf = getSelectedGridListLeaf(wndAnim, 'animlist') if not leaf then return end end server.setPedAnimation(g_Me, leaf.parent.name, leaf.name, true, true) end function stopAnimation() server.setPedAnimation(g_Me, false) end wndAnim = { 'wnd', text = 'Set animation', width = 250, x = -20, y = 0.3, controls = { { 'lst', id='animlist', width=230, height=290, columns={ {text='Animation', attr='name'} }, rows={xml='animations.xml', attrs={'name'}}, expandlastlevel=false, onitemdoubleclick=applyAnimation }, {'btn', id='set', onclick=applyAnimation}, {'btn', id='stop', onclick=stopAnimation}, {'btn', id='close', closeswindow=true} } } addCommandHandler('anim', function(command, lib, name) server.setPedAnimation(g_Me, lib, name, true, true) end ) --------------------------- -- Walking Style Window --------------------------- function applyWalkStyle( leaf ) if type( leaf ) ~= 'table' then leaf = getSelectedGridListLeaf( wndWalking, 'walkStyle' ) if not leaf then return end end server.setPedWalkingStyle( g_Me, leaf.id ) end function stopWalkStyle() server.setPedWalkingStyle( g_Me, 0 ) end wndWalking = { 'wnd', text = 'Walking style', width = 250, controls = { { 'lst', id = 'walkStyle', width = 230, height = 290, columns = { { text = 'Walking', attr = 'name' } }, rows = { xml = 'walkstyle.xml', attrs = { 'id', 'name' } }, onitemdoubleclick = applyWalkStyle }, { 'btn', id = 'set', onclick = applyWalkStyle }, { 'btn', id = 'stop', onclick = stopWalkStyle }, { 'btn', id = 'close', closeswindow = true } } } function setWalkStyleCommand( cmd, id ) id = id and tonumber( id ) if id then server.setPedWalkingStyle( id ) end end addCommandHandler( 'setwalkstyle', setWalkStyleCommand ) addCommandHandler( 'walkstyle', setWalkStyleCommand ) --------------------------- -- Weapon window --------------------------- function addWeapon(leaf, amount) if type(leaf) ~= 'table' then leaf = getSelectedGridListLeaf(wndWeapon, 'weaplist') amount = getControlNumber(wndWeapon, 'amount') if not amount or not leaf then return end end server.giveMeWeapon(leaf.id, amount) end wndWeapon = { 'wnd', text = 'Give weapon', width = 250, controls = { { 'lst', id='weaplist', width=230, height=280, columns={ {text='Weapon', attr='name'} }, rows={xml='weapons.xml', attrs={'id', 'name'}}, onitemdoubleclick=function(leaf) addWeapon(leaf, 500) end }, {'br'}, {'txt', id='amount', text='500', width=60}, {'btn', id='add', onclick=addWeapon}, {'btn', id='close', closeswindow=true} } } function giveWeaponCommand(cmd, weapon, amount) weapon = tonumber(weapon) or getWeaponIDFromName(weapon) if not weapon then return end amount = amount and tonumber(amount) or 500 server.giveMeWeapon(math.floor(weapon), amount) end addCommandHandler('give', giveWeaponCommand) addCommandHandler('wp', giveWeaponCommand) --------------------------- -- Fighting style window --------------------------- wndFighting = { 'wnd', text = 'Set Fighting style', width = 250, x = -20, y = 0.3, controls = { { 'lst', id='fighting', width=230, height=290, columns={ {text='style', attr='name'} }, rows={xml='fighting.xml', attrs={'name'}}, expandlastlevel=false, onitemdoubleclick=applyFightingStyle }, {'btn', id='Set', onclick=applyFightingStyle}, {'btn', id='Close', closeswindow=true} } } addCommandHandler('setstyle', function(s, cmd, style) style = style or tonumber(style) if style then setPedFightingStyle(s, style) end end )
  12. ZeyadGTX

    Freeroam

    Isn't there another problems in fighting.xml or adding lines to fr_server.lua ?
  13. ZeyadGTX

    Freeroam

    Hello i tried to add fightingStyle in Freeroam but i failed that's what i did Fr_client.lua --------------------------- -- Fighting style window --------------------------- wndFighting = { 'wnd', text = 'Set Fighting style', width = 250, x = -20, y = 0.3, controls = { { 'lst', id='fighting', width=230, height=290, columns={ {text='style', attr='name'} }, rows={xml='fighting.xml', attrs={'name'}}, expandlastlevel=false, onitemdoubleclick=applyFightingStyle }, {'btn', id='Set', onclick=applyFightingStyle}, {'btn', id='Close', closeswindow=true} } } addCommandHandler('setstyle', function(cmd, style) style = style and tonumber(style) if style then server.setPedFightingStyle(g_Me, style) end end ) Meta.xml "fighting.xml" type="client" /> fighting.xml type="style"> Also the button added {'btn', id='Fighting Style', window=wndFighting},
  14. ZeyadGTX

    Givemoney

    I use this givemoney resource which you use /givemoney playername amount but the problem that you can send money by negative like /givemoney playername -9999 and your money get decreasing i want to disable that ! function giveSomeoneMoney(player, cmd, target, amount) if target then if amount then local money = getPlayerMoney(player) local targetplayer = getPlayerFromParticalName(target) local r,g,b = getPlayerNametagColor(player) amount = tonumber(amount) if targetplayer then if money >= amount then givePlayerMoney(targetplayer, amount) takePlayerMoney(player, amount) outputChatBox("You Were Given #00FF00$"..tostring(amount).." #006400 From #FF0000"..getPlayerName(player) , targetplayer, 0, 100, 0, true) outputChatBox("You Gave #00FF00$"..tostring(amount).."#006400 To #FF0000"..getPlayerName(targetplayer), player, 0, 100, 0, true) else outputChatBox("You Don't Have Enough Money ! , player, 255, 0, 0) end end addCommandHandler("givemoney", giveSomeoneMoney) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end
  15. ZeyadGTX

    Add

    Thats addEvent("addToTeam", true) addEventHandler("addToTeam", root, function (playerName, teamName) local player = getPlayerFromName(playerName) local team = getPlayerFromName(teamName) if player and team then local r, g, b = getTeamColor(team) setPlayerTeam(player, team) setPlayerNametagColor(player, r, g, b) outputChatBox("You have been moved to #FFFFFF" .. getTeamName(team) .. "#FF0000.", player, 255, 0, 0, true) end end )
  16. ZeyadGTX

    Add

    Ok Client Side local sx, sy = guiGetScreenSize ( ) local y = sy + 20 function onRankUpGreet() dxDrawRectangle(sx*(707/1024), sy*(425/768), sx*(115/1024), sy*(27/768), tocolor(44, 44, 44, 221), true) dxDrawText("Rank up+", sx*(716/1024), sy*(429/768), sx*(808/1024), sy*(448/768), tocolor(0, 255, 0, 221), 0.70, "bankgothic", "left", "top", false, false, true, false, false) end function onTestExp( ) if ( y > ( sy / 2 ) ) then y = y - 2 elseif ( y < ( sy / 2 ) ) then y = ( sy / 2 ) end dxDrawText ( "+"..tostring(experience).." XP", 400, y, sx, 200, tocolor(255, 255, 0, 255), 0.7, "bankgothic") end addEvent("onTestExp", true) addEventHandler( "onTestExp", root, function(expe) if not isTimer(expTimer) then expTimer = setTimer(function() removeEventHandler("onClientRender", root, onTestExp) end, 6000, 1) experience = expe addEventHandler("onClientRender", root, onTestExp) else experience = (experience + expe) resetTimer(expTimer) end end) function onRankUp( killer ) local sound = playSound("sounds/level.mp3") setSoundVolume(sound, 50) setSoundMaxDistance( sound, 5000 ) addEventHandler("onClientRender", root, onRankUpGreet) setTimer( function () removeEventHandler ( "onClientRender", root, onRankUpGreet ) end, 6000, 1) end addEvent( "onClientRankUp", true ) addEventHandler( "onClientRankUp", getRootElement(), onRankUp ) function getXP ( _, playerName ) if ( playerName ) then local thePlayer = getPlayerFromParticalName ( playerName ) if ( thePlayer ) then local Level = getElementData(thePlayer,"LV") or 0 local XP = getElementData(thePlayer,"EXP") or 0 outputChatBox ( getPlayerName ( thePlayer ) .." XP ".. tostring ( XP ) .." LV:".. tostring ( Level ) .." " ,0,255,200) else outputChatBox ( "Couldn't find '" .. playerName .. "'", source ) end end end addCommandHandler ( "getxp", getXP ) addCommandHandler ( "getXP", getXP ) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end Clan = { Button = {}, Window = {}, Gridlist = {}, Edit = {} } Clan.Window[1] = guiCreateWindow(306, 174, 320, 346, "Clan panel", false) guiWindowSetSizable(Clan.Window[1], false) Clan.Window[2] = guiCreateWindow(401, 281, 252, 99, "Set Player Rank", false) guiWindowSetSizable(Clan.Window[2], false) Clan.Window[3] = guiCreateWindow(401, 281, 252, 99, "Set Player Rank", false) guiWindowSetSizable(Clan.Window[3], false) Clan.Gridlist[1] = guiCreateGridList(9, 25, 188, 311, false, Clan.Window[1]) local column = guiGridListAddColumn(Clan.Gridlist[1], "Players", 0.9) if ( column ) then --If the column has been created, fill it with players for _,v in ipairs(getElementsByType("player"))do local row = guiGridListAddRow(Clan.Gridlist[1]) local players = getPlayerName(v) guiGridListSetItemText(Clan.Gridlist[1],row,column,players,false,false) end end Clan.Button[1] = guiCreateButton(204, 51, 106, 38, "Add", false, Clan.Window[1]) Clan.Button[2] = guiCreateButton(204, 96, 106, 38, "Kick", false, Clan.Window[1]) Clan.Button[3] = guiCreateButton(204, 144, 106, 38, "Promote", false, Clan.Window[1]) Clan.Button[4] = guiCreateButton(204, 192, 106, 38, "Demote", false, Clan.Window[1]) Clan.Button[5] = guiCreateButton(204, 288, 106, 38, "Close", false, Clan.Window[1]) Clan.Button[6] = guiCreateButton(13, 62, 87, 23, "Cancel", false, Clan.Window[2]) Clan.Button[7] = guiCreateButton(143, 62, 87, 23, "Set", false, Clan.Window[2]) Clan.Button[8] = guiCreateButton(13, 62, 87, 23, "Cancel", false, Clan.Window[3]) Clan.Button[9] = guiCreateButton(143, 62, 87, 23, "Set", false, Clan.Window[3]) Clan.Edit[1] = guiCreateEdit(13, 29, 227, 28, "", false, Clan.Window[2]) Clan.Edit[2] = guiCreateEdit(13, 29, 227, 28, "", false, Clan.Window[3]) guiSetVisible(Clan.Window[1], false) guiSetVisible(Clan.Window[2], false) guiSetVisible(Clan.Window[3], false) showCursor(false) if getElementData(localPlayer, "clan.rank") == "leader" or getElementData(localPlayer, "player.key") == "Zeyad" or getElementData(localPlayer, "player.key") == "" or getElementData(localPlayer, "player.key") == "" or getElementData(localPlayer, "player.key") == "" then guiSetEnabled(Clan.Button[3], true) guiSetEnabled(Clan.Button[4], true) else guiSetEnabled(Clan.Button[3], false) guiSetEnabled(Clan.Button[4], false) end function toggleClanControl( source ) if getElementData(localPlayer, "player.key") == "Zeyad" or getElementData(localPlayer, "player.key") == "Azer" or getElementData(localPlayer, "player.key") == "ryder" or getElementData(localPlayer, "player.key") == "Sayari" then if not guiGetVisible( Clan.Window[1] ) then showCursor ( true ) guiSetVisible( Clan.Window[1], true ) guiGridListClear ( Clan.Gridlist[1] ) if ( column ) then guiGridListClear ( Clan.Gridlist[1] ) for _,v in ipairs(getElementsByType("player"))do local row = guiGridListAddRow(Clan.Gridlist[1]) local playerName = getPlayerName(v) guiGridListSetItemText(Clan.Gridlist[1],row,column,playerName,false,false) end end if getElementData(localPlayer, "clan.rank") == "leader" or getElementData(localPlayer, "player.key") == "Zeyad" or getElementData(localPlayer, "player.key") == "Azer" or getElementData(localPlayer, "player.key") == "ryder" or getElementData(localPlayer, "player.key") == "Script" then guiSetEnabled(Clan.Button[3], true) guiSetEnabled(Clan.Button[4], true) else guiSetEnabled(Clan.Button[3], false) guiSetEnabled(Clan.Button[4], false) end else showCursor ( false ) guiSetVisible( Clan.Window[1], false ) end end end bindKey( "M", "down", toggleClanControl ) addCommandHandler("clan", toggleClanControl) addEventHandler("onClientGUIClick", guiRoot, function() if source == Clan.Button[1] then local row, column = guiGridListGetSelectedItem(Clan.Gridlist[1]) if row == -1 then return end local playerName = guiGridListGetItemText(Clan.Gridlist[1],row,column) local player = getPlayerFromName(playerName) local team = getPlayerTeam(localPlayer) local teamName = getTeamName(team) if not playerName then guiGridListRemoveRow(row) return end triggerServerEvent("addToTeam", localPlayer,playerName,teamName) end end) addEventHandler("onClientGUIClick", guiRoot, function() if source == Clan.Button[2] then local row, column = guiGridListGetSelectedItem(Clan.Gridlist[1]) if row == -1 then return end local playerName = guiGridListGetItemText(Clan.Gridlist[1],row,column) local player = getPlayerFromName(playerName) local team = getPlayerTeam(localPlayer) local teamName = getTeamName(team) if not playerName then guiGridListRemoveRow(row) return end triggerServerEvent("kickFromTeam", localPlayer,playerName,teamName) end end) function closeClan() if guiGetVisible(Clan.Window[1]) then guiSetVisible(Clan.Window[1],false) showCursor(false) end end addEventHandler ("onClientGUIClick", Clan.Button[5], closeClan, false) function togglePromote( source ) -- Show the panel if not guiGetVisible( Clan.Window[2] ) then showCursor ( true ) guiSetVisible( Clan.Window[2], true ) guiMoveToBack( Clan.Window[1] ) else showCursor ( true ) guiSetVisible( Clan.Window[2], false ) end end addEventHandler ( "onClientGUIClick", Clan.Button[3], togglePromote, false ) addEventHandler("onClientGUIClick",Clan.Button[7], function() local row, column = guiGridListGetSelectedItem(Clan.Gridlist[1]) if row == -1 then return end local playerName = guiGridListGetItemText(Clan.Gridlist[1],row,column) local player = getPlayerFromName(playerName) if not playerName then guiGridListRemoveRow(row) return end triggerServerEvent("promotePlayer",localPlayer,playerName,tostring(guiGetText(Clan.Edit[1])) or "Member") guiSetVisible( Clan.Window[2], false ) showCursor ( true ) end,false) function closeClan() if guiGetVisible(Clan.Window[2]) then guiSetVisible(Clan.Window[2],false) showCursor(true) end end addEventHandler ("onClientGUIClick", Clan.Button[6], closeClan, false) function toggleDemote( source ) -- Show the panel if not guiGetVisible( Clan.Window[2] ) then showCursor ( true ) guiSetVisible( Clan.Window[2], true ) guiMoveToBack( Clan.Window[1] ) else showCursor ( true ) guiSetVisible( Clan.Window[2], false ) end end addEventHandler ( "onClientGUIClick", Clan.Button[4], toggleDemote, false ) addEventHandler("onClientGUIClick",Clan.Button[9], function() local row, column = guiGridListGetSelectedItem(Clan.Gridlist[1]) if row == -1 then return end local playerName = guiGridListGetItemText(Clan.Gridlist[1],row,column) local player = getPlayerFromName(playerName) if not playerName then guiGridListRemoveRow(row) return end triggerServerEvent("DemotePlayer",localPlayer,playerName,tostring(guiGetText(Clan.Edit[2])) or "Member")
  17. ZeyadGTX

    Add

    Hello I have Resource but i need to modify this lines bec there are buttons to add in teams and this is ADD functions its not working addEvent("addToTeam", true) addEventHandler("addToTeam", root, function() local player = getPlayerFromName() local team = getTeamFromName() if player and team then local r, g, b = getTeamColor(team) setPlayerTeam(player, team) setPlayerNametagColor(player, r, g, b) outputChatBox("You have been moved to #FFFFFF" .. getTeamName(team) .. "#FF0000.", player, 255, 0, 0, true) end end ) My buttons Client Side : Clan.Button[1] = guiCreateButton(204, 51, 106, 38, "Add", false, Clan.Window[1]) Clan.Button[2] = guiCreateButton(204, 96, 106, 38, "Kick", false, Clan.Window[1]) Clan.Button[3] = guiCreateButton(204, 144, 106, 38, "Promote", false, Clan.Window[1]) Clan.Button[4] = guiCreateButton(204, 192, 106, 38, "Demote", false, Clan.Window[1]) Clan.Button[5] = guiCreateButton(204, 288, 106, 38, "Close", false, Clan.Window[1]) Clan.Button[6] = guiCreateButton(13, 62, 87, 23, "Cancel", false, Clan.Window[2]) Clan.Button[7] = guiCreateButton(143, 62, 87, 23, "Set", false, Clan.Window[2]) Clan.Button[8] = guiCreateButton(13, 62, 87, 23, "Cancel", false, Clan.Window[3]) Clan.Button[9] = guiCreateButton(143, 62, 87, 23, "Set", false, Clan.Window[3]) Clan.Edit[1] = guiCreateEdit(13, 29, 227, 28, "", false, Clan.Window[2]) Clan.Edit[2] = guiCreateEdit(13, 29, 227, 28, "", false, Clan.Window[3]) guiSetVisible(Clan.Window[1], false) guiSetVisible(Clan.Window[2], false) guiSetVisible(Clan.Window[3], false)
  18. ZeyadGTX

    Headshot

    You mean backUp timer ? The Back up in line 7 ?
  19. ZeyadGTX

    Headshot

    I tried That But The head doesn't return if spawned the player is headLess function MakePlayerHeadshot( attacker, weapon, bodypart, loss ) if getElementType ( attacker ) == "ped" then if bodypart == 9 then triggerEvent( "onPlayerHeadshot", source, attacker, weapon, loss ) setPedHeadless ( source, true ) killPed( source, attacker, weapon, bodypart ) setTimer( BackUp, 900, 1, source ) end end end function MakeHeadshot( source, attacker, weapon, loss ) triggerEvent( "onPlayerHeadshot", source, attacker, weapon, loss ) killPed( source, attacker, weapon, 9 ) setPedHeadless ( source, true ) setTimer( BackUp, 900, 1, source ) end function BackUp( source ) if getElementType ( source ) == "player" then setPedHeadless ( source, true ) end end function outputHeadshotIcon (killer, weapon, bodypart) if bodypart == 9 then cancelEvent() local r2,g2,b2 = getTeamColor ( getPlayerTeam( killer ) ) local r1,g1,b1 = getTeamColor ( getPlayerTeam( source ) ) exports.killmessages:outputMessage ( {getPlayerName(killer),{"padding",width=3},{"icon",id=weapon},{"padding",width=3},{"icon",id=256},{"padding",width=3},{"color",r=r1,g=g1,b=b1},getPlayerName(source) }, getRootElement(),r2,g2,b2) end end addEvent ( "onServerHeadshot", true ) addEventHandler( "onPlayerDamage", getRootElement(), MakePlayerHeadshot ) addEventHandler( "onPlayerKillMessage", getRootElement(), outputHeadshotIcon ) addEventHandler( "onServerHeadshot", getRootElement(), MakeHeadshot )
  20. ZeyadGTX

    Headshot

    I use this Headshot but i want to make when player gets headshot his head removes untill respawn because his head returns again before spawn Client : function sendHeadshot ( attacker, weapon, bodypart, loss ) if attacker == getLocalPlayer() then if bodypart == 9 then triggerServerEvent( "onServerHeadshot", getRootElement(), source, attacker, weapon, loss ) setElementHealth ( source, 0 ) setPedHeadless( source, true ) end end end addEventHandler ( "onClientPedDamage", getRootElement(), sendHeadshot ) addEventHandler ( "onClientPlayerDamage", getRootElement(), sendHeadshot ) Server : function MakePlayerHeadshot( attacker, weapon, bodypart, loss ) if getElementType ( attacker ) == "ped" then if bodypart == 9 then triggerEvent( "onPlayerHeadshot", source, attacker, weapon, loss ) setPedHeadless ( source, true ) killPed( source, attacker, weapon, bodypart ) setTimer( BackUp, 900, 1, source ) end end end function MakeHeadshot( source, attacker, weapon, loss ) triggerEvent( "onPlayerHeadshot", source, attacker, weapon, loss ) killPed( source, attacker, weapon, 9 ) setPedHeadless ( source, true ) setTimer( BackUp, 900, 1, source ) end function BackUp( source ) if getElementType ( source ) == "player" then setPedHeadless ( source, false ) end end function outputHeadshotIcon (killer, weapon, bodypart) if bodypart == 9 then cancelEvent() local r2,g2,b2 = getTeamColor ( getPlayerTeam( killer ) ) local r1,g1,b1 = getTeamColor ( getPlayerTeam( source ) ) exports.killmessages:outputMessage ( {getPlayerName(killer),{"padding",width=3},{"icon",id=weapon},{"padding",width=3},{"icon",id=256},{"padding",width=3},{"color",r=r1,g=g1,b=b1},getPlayerName(source) }, getRootElement(),r2,g2,b2) end end addEvent ( "onServerHeadshot", true ) addEventHandler( "onPlayerDamage", getRootElement(), MakePlayerHeadshot ) addEventHandler( "onPlayerKillMessage", getRootElement(), outputHeadshotIcon ) addEventHandler( "onServerHeadshot", getRootElement(), MakeHeadshot )
×
×
  • Create New...