-
Posts
1,491 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Walid
-
it can be like this: function stopVehicle(player) if (getTeamName(getPlayerTeam(player)) == "Staff") then local vehicles = getElementsByType("vehicle") for i , vehicle in pairs (vehicles) do local Freeze = isElementFrozen (vehicle) local newStatus = not Freeze setElementFrozen (vehicle, newStatus ) end end end addCommandHandler("stop", stopVehicle)
-
use setElementFrozen ()
-
use isPedInVehicle () addCommandHandler ("fly", function () if (getTeamName(getPlayerTeam(localPlayer)) == "Staff") then if isPedInVehicle (localPlayer) then if not flyEnabled then setWorldSpecialPropertyEnabled ( "aircars", true ) outputChatBox("Flying Cars is now Enabled",255, 255, 255) flyEnabled = true else outputChatBox("Flying Cars is now Disabled",255, 255, 255) setWorldSpecialPropertyEnabled ( "aircars", false ) flyEnabled = false end end end end )
-
What ??? try this it's client side addCommandHandler ("fly", function () if (getTeamName(getPlayerTeam(localPlayer)) == "Staff") then if not flyEnabled then setWorldSpecialPropertyEnabled ( "aircars", true ) outputChatBox("Flying Cars is now Enabled",255, 255, 255) flyEnabled = true else outputChatBox("Flying Cars is now Disabled",255, 255, 255) setWorldSpecialPropertyEnabled ( "aircars", false ) flyEnabled = false end end end ) np
-
it can be all Client side i don't know why u are trying to use tiggerServerEvent() local cst = false function flyCar() if (getTeamName(getPlayerTeam(localPlayer)) == "Staff") then if cst then setWorldSpecialPropertyEnabled("aircars", false) outputChatBox("Flying Cars is now Disabled",255, 255, 255) cst = false else setWorldSpecialPropertyEnabled("aircars", true) outputChatBox("Flying Cars is now Enabled",255, 255, 255) cst = true end end end addCommandHandler("fly", flyCar)
-
there is many things wrong in your code anyways try this local Markerwejscie = createMarker(462,-1500.8000488281,31.60000038147,"arrow",1.20000004,0,0,0,0) local marker = createMarker(207.60000610352,-100.90000152588,1004.299987793,"cylinder",1,0,0,0,0) local Markerwyjscie = createMarker(207.69999694824,-111.59999847412,1005.9000244141,"arrow",1.20000004,0,0,0,0) local sprzedawca = createPed(211,207.60000610352,-98.599998474121,1005.299987793,180.005493) local blip = createBlip(462,-1500.8000488281,31.60000038147, 45) skinsTable = {} skinsTable.all = {} skinsTable.categories = {} function Wejscie(player) if getElementType(player)=="player" then if source == wejscie then setElementPosition(player,207.69999694824,-109.90000152588,1005.0999755859,0.00274658,0,0) setElementInterior(player,15) setElementInterior(sprzedawca,15) setElementFrozen(player,true) setTimer(setElementFrozen,2000,1,player,false) end end end addEventHandler("onMarkerHit", Markerwejscie, Wejscie) function Wyjscie(player) if getElementType(player)=="player" then if source == wyjscie then setElementPosition(player,459.20001220703,-1500.9000244141,31,96.0027465,0,0) setElementInterior(player,0) setElementFrozen(player, true) setTimer(setElementFrozen,2000,1,player,false) end end end addEventHandler("onMarkerHit", Markerwyjscie, Wyjscie) function Skiny() local xml = xmlLoadFile("Skiny.xml") for index, category in pairs(xmlNodeGetChildren(xml)) do local cName = xmlNodeGetAttribute(category, "name") skinsTable.categories[cName] = {} for index, skin in pairs(xmlNodeGetChildren(category)) do local id, Nazwa = xmlNodeGetAttribute(skin, "Model"), xmlNodeGetAttribute(skin, "name") skinsTable.categories[cNames][id] = Nazwa skinsTable.all[id] = Nazwa end end xmlUnloadFile(xml) end addEventHandler("onResourceStart", resourceRoot, Skiny) function WybieranieSkina(player, matchingDimension) if (player and getElementType(player) == "player" and matchingDimension) then local skins = getSkinsTable() triggerServerEvent(player, "clothes.showSkin", player, skins) triggerServerEvent(player, "clothes.showSkin", player, skins) end end
-
i already gave it to you addEventHandler ( "onClientPlayerDamage", localPlayer, function( attacker, weapon, bodypart ) local playerTeam = getPlayerTeam(source) if playerTeam and if ( weapon == 37 ) and ( getTeamName(playerTeam) == "tactics" ) then cancelEvent() end end end ) untested you must read this about death reason : Here When a player was shot by a weapon, the respective weapon ID is the death reason ID
-
post debugscript here + full code
-
it must be like this : addEventHandler ( "onClientPlayerDamage", localPlayer, function( attacker, weapon, bodypart ) if attacker and isElement(attacker) and getElementType(attcker) == "player" and attacker ~= source then if (getTeamName(getPlayerTeam(attacker)) == "tactics") and (getTeamName(getPlayerTeam(source)) == "tactics") then cancelEvent() end end end ) Edit
-
there is no category in your "Skiny.xml" you must add sth like this
-
You must add the argument weapon. addEventHandler ( "onClientPlayerDamage", localPlayer, function( attacker, weapon, bodypart ) local playerTeam = getPlayerTeam(source) if playerTeam and if ( weapon == 37 ) and ( getTeamName(playerTeam) == "tactics" ) then cancelEvent() end end end )
-
Show me your "Skiny.xml" file
-
what ??? show me full code
-
Try this one addEventHandler ( "onClientPlayerDamage", localPlayer, function() local playerTeam = getPlayerTeam(source) if playerTeam and if ( weapon == 37 ) and ( getTeamName(playerTeam) == "tactics" ) then cancelEvent() end end end )
-
Man what are you talking about , try to use some Screen shots or record a video.
-
Try this copy and past my code i changed many things function table.size(tab) local length = 0 for _ in pairs(tab) do length = length + 1 end return length end addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() AmmoMenu = guiCreateWindow((screenW - 465) / 2, (screenH - 834) / 2, 465, 834, "Ammu-Nation", false) guiWindowSetSizable(AmmoMenu, false) AmmuNationImage = guiCreateStaticImage(67, 54, 332, 88, ":weapons/ammu-nation.png", false, AmmoMenu) TazerImage = guiCreateStaticImage(52, 179, 70, 56, ":weapons/Tazer.png", false, AmmoMenu) PistolImage = guiCreateStaticImage(52, 253, 70, 59, ":weapons/Pistol.png", false, AmmoMenu) DeserteagleImage = guiCreateStaticImage(52, 328, 70, 55, ":weapons/Desert_Eagle.png", false, AmmoMenu) Ak47Image = guiCreateStaticImage(33, 739, 113, 44, ":weapons/ak47.png", false, AmmoMenu) UziImage = guiCreateStaticImage(53, 401, 69, 52, ":weapons/uzi.png", false, AmmoMenu) Tec9Image = guiCreateStaticImage(53, 468, 69, 50, ":weapons/tec9.png", false, AmmoMenu) Mp5Image = guiCreateStaticImage(46, 532, 86, 45, ":weapons/mp5.png", false, AmmoMenu) Spas12Image = guiCreateStaticImage(33, 592, 113, 50, ":weapons/Spas-12.png", false, AmmoMenu) M4Image = guiCreateStaticImage(33, 663, 114, 55, ":weapons/M4A1.png", false, AmmoMenu) AmmountLabel = guiCreateLabel(196, 478, 55, 17, "Ammount", false, AmmoMenu) AmmountTextbox = guiCreateEdit(172, 508, 104, 24, "", false, AmmoMenu) guiEditSetMaxLength(AmmountTextbox, 6) BuyButton = guiCreateButton(172, 729, 126, 59, "Buy Cart", false, AmmoMenu) guiSetFont(BuyButton, "default-bold-small") guiSetProperty(BuyButton, "NormalTextColour", "FF0000FF") QuitButton = guiCreateButton(315, 729, 126, 59, "Quit", false, AmmoMenu) guiSetFont(QuitButton, "default-bold-small") guiSetProperty(QuitButton, "NormalTextColour", "FFFF0000") Cartlist = guiCreateGridList(172, 551, 269, 122, false, AmmoMenu) Weaponcolumn = guiGridListAddColumn(Cartlist, "Weapon", 0.3) Amountcolumn = guiGridListAddColumn(Cartlist, "Amount", 0.3) Pricecolumn = guiGridListAddColumn(Cartlist, "Price", 0.3) AddcartButton = guiCreateButton(314, 508, 89, 27, "Add to cart", false, AmmoMenu) WeaponInfo = guiCreateScrollPane(177, 179, 223, 238, false, AmmoMenu) Infolabel = guiCreateLabel(17, 150, 150, 19, "Press icon for information", false, AmmoMenu) guiSetFont(Infolabel, "default-bold-small") guiGridListSetSortingEnabled (Cartlist,false) guiSetVisible(AmmoMenu,false) end ) function chooseweapon() if source == TazerImage then WeaponChosen = 23 elseif source == PistolImage then WeaponChosen = 22 elseif source == DeserteagleImage then WeaponChosen = 24 elseif source == Ak47Image then WeaponChosen = 30 elseif source == UziImage then WeaponChosen = 28 elseif source == Tec9Image then WeaponChosen = 32 elseif source == Mp5Image then WeaponChosen = 29 elseif source == Spas12Image then WeaponChosen = 27 elseif source == M4Image then WeaponChosen = 31 -- Add weapons elseif source == AddcartButton then if WeaponChosen then if tonumber(guiGetText(AmmountTextbox)) ~= nil then if tonumber(guiGetText(AmmountTextbox)) > 0 then if tonumber(guiGetText(AmmountTextbox)) == math.floor(guiGetText(AmmountTextbox)) then local row = guiGridListAddRow(Cartlist) table.insert(weapontable,{WeaponChosen,guiGetText(AmmountTextbox),math.floor(10 * guiGetText(AmmountTextbox))}) guiGridListSetItemText(Cartlist,row,Weaponcolumn,""..getWeaponNameFromID(WeaponChosen),false,false) guiGridListSetItemText(Cartlist,row,Amountcolumn,""..guiGetText(AmmountTextbox),false,false) guiGridListSetItemText(Cartlist,row,Pricecolumn,"$"..tonumber(math.floor(10 * guiGetText(AmmountTextbox))),false,false) else outputChatBox("Please enter a integer!",255,0,0) end else outputChatBox("Please enter a positive number!",255,0,0) end else outputChatBox("Please enter a integer as the ammount of ammo",255,0,0) end else outputChatBox("Please choose a weapon by clicking on the icon of it",255,0,0) end elseif source == BuyButton then if guiGridListGetRowCount(Cartlist) > 0 then for i , v in pairs (weapontable) do local totalprice = totalprice + tonumber(v[3]) if getPlayerMoney(localPlayer) >= totalprice then triggerServerEvent("giveweapon",localPlayer,v[1],v[2]) takePlayerMoney(totalprice) else outputChatBox("You don't have enough money!",255,0,0) end end else outputChatBox("You don't have anything in your cart!",255,0,0) end elseif source == QuitButton then showCursor(false) guiSetVisible(AmmoMenu,false) guiGridListClear (Cartlist) guiSetText (AmmountTextbox,"") end end addEventHandler("onClientGUIClick",resourceRoot,chooseweapon) function showGUI() weapontable = {} totalprice = 0 showCursor(true) guiSetVisible(AmmoMenu,true) end addEvent("showweaponGUI",true) addEventHandler("showweaponGUI",getRootElement(),showGUI)
-
np , about the second question sorry i don't undrestand what you want exactly
-
Check my code i already gave you the solution.
-
it must be like this addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do local attached = getAttachedElements (player) if ( attached ) then local playerTeam = getPlayerTeam(player) if (playerTeam) then if ( getTeamName (playerTeam) == "tactics" ) then for _, element in ipairs (attached) do if (getElementType (element) == "blip" ) then destroyElement ( element ) end end end end end end end)
-
Try this untested. local TimeTable = {} local waitTime = 3000 -- 3 seconds local Blips = {} local details = {} local Entred = {} local Markers = { {522, 1986, -1478.1, 21.5, 17.500, "Sonix #1"}, -- Marker 1 {522, 1114, -1822, 33.5, 17.500,"Sonix #2"}, -- Marker 2 {522, 776.8, -1036, 39.5, 9000,"StantName Here"}, -- Marker 3 {522, 1313, -1163, 41, 7500,"StantName Here"}, -- Marker 4 {522, 1404, -806, 85, 7500,"StantName Here"}, -- Marker 5 {522, 775.7, -1060.5, 33.2, 5000,"StantName Here"}, -- Marker 6 } for i , v in pairs (Markers) do HitMarker = createMarker ( v[2], v[3], v[4], "corona", 1.20, 255, 0, 0, 255 ) Blips[HitMarker] = createBlipAttachedTo( HitMarker, 0 ) details[HitMarker] = {v[1],v[5],v[6]} end function allowedVehicles( hitElement, matchingDimension ) if matchingDimension and isElement(hitElement) and getElementType(hitElement) == "player" then if isPedInVehicle ( hitElement ) then local vehicle = getPedOccupiedVehicle ( hitElement ) if vehicle then if Entred[hitElement] == source then outputChatBox("Sorry you can't enter the marker twice" , hitElement,255,0,0) return end local theTable = details[source] if (theTable) then local model, cash, name = details[source][1], details[source][2], details[source][3] if getElementModel ( vehicle ) == model then TimeTable[hitElement] = setTimer(StuntComplete, waitTime, 1, hitElement,source,cash,name) setElementData ( hitElement, "entered.marker", true ) Entred[hitElement] = source else outputChatBox ( "You have entered in Stunt with wrong vehicle", hitElement, 255, 0, 0 ) end end end end end end addEventHandler( "onMarkerHit", resourceRoot, allowedVehicles ) function StuntComplete (player,marker,cash,markerName) if isElement ( player ) then if getElementData ( player, "entered.marker" ) then givePlayerMoney ( player, tonumber(cash)) outputChatBox ( "You have completed the Stunt and earned "..tonumber(cash).."$", player, 0, 255, 0 ) if isElement( Blips[marker] ) then setBlipColor ( Blips[marker], 0, 255, 0, 255 ) setMarkerColor (marker,0, 255, 0, 255 ) end local playerAccount = getPlayerAccount ( player ) if ( playerAccount ) and not isGuestAccount ( playerAccount ) then local totalStunts = getAccountData ( playerAccount, "totalStunts" ) or 0 local name = markerName local rb,gb,bb,ab = getBlipColor ( Blips[marker] ) local rm,gm,bm,am = getMarkerColor ( marker ) local Det = toJSON({name,rb,gb,bb,ab,rm,gm,bm,am}) setAccountData ( playerAccount, "Details", Det ) setAccountData( playerAccount, "totalStunts" , tonumber(totalStunts)+1) end end end end addEventHandler ( "onMarkerLeave", resourceRoot, function ( leaveElement ) if ( isElement ( leaveElement ) and getElementType ( leaveElement ) == "player" ) then setElementData ( leaveElement, "entered.marker", false ) outputChatBox("You failed the Stunt!", leaveElement, 255, 0, 0) end end ) function stuntsFinished ( player ) if isElement(player) then local playerAccount = getPlayerAccount ( player ) if ( playerAccount ) and not isGuestAccount ( playerAccount ) then local count = getAccountData( playerAccount, "totalStunts" ) or 0 outputChatBox( "You have finished "..tonumber(count).."/512 Stunts", player, 0, 255, 0) end end end addCommandHandler("fstunts", stuntsFinished) function Load (_,cur) local Det = getAccountData(cur,"Details") if Det then local marName,rb,gb,bb,ab,rm,gm,bm,am = unpack( fromJSON(Det)) for i , mar in pairs (getElementsByType("marker")) do local theTable = details[mar] if (theTable) then local name = details[mar][3] if name == tostring(marName) then setMarkerColor (mar,tonumber(rm),tonumber(gm),tonumber(bm),tonumber(am)) end end end end end addEventHandler("onPlayerLogin",root,Load)
-
صحيح to prevent this addEventHandler("onClientGUIClick", root, -- الحدث function () -- الوظيفة if source == أسم الزر then -- عند الظغط على الزر if (sound and isElement(sound) and getElementType(sound) == "sound") then destroyElement(sound) sound = nil return end sound = playSound("Grand.mp3") -- تشغيل الصوت setSoundVolume(sound, 1) -- نضع قوة الصوت 1 end -- أنهاء التحقق end -- إنهاء الوظيفة ) -- قوس الحدث
-
use this function setElementVisibleTo ()