Jump to content

Walid

Members
  • Posts

    1,491
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Walid

  1. explain your problem better
  2. Post full code here i need to check sth. Fixed it, actually forgot to add that 2nd argument. Sorry and Thank you very much you are welcome.
  3. Post full code here i need to check sth.
  4. You need to use removePedClothes on player login. Try this -- Save addEventHandler ( "onPlayerQuit", root, function ( ) local account = getPlayerAccount ( source ) if ( isGuestAccount( account ) ) then return end local clothes = { } for i=0, 17 do clothes[i] = { getPedClothes ( source, i ) } end clothes = toJSON ( clothes ) setAccountData ( account, "Clothes", clothes ) end ) -- Load addEventHandler ( "onPlayerLogin", root, function ( _, account ) local clothes = getAccountData ( account, "Clothes" ) if not clothes then return end removeAllPedClothes(source) for i, v in pairs ( fromJSON ( clothes ) ) do local text, id = unpack ( v ) if text then addPedClothes ( source, text, id, i ) end end end ) -- Remove all function removeAllPedClothes(thePed) for i=0, 17 do removePedClothes(thePed, i) end return true end
  5. you didn't, show me your try
  6. As i told many things wrong try this one GUIEditor = { checkbox = {}, staticimage = {}, label = {}, button = {}, window = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(542, 254, 348, 92, "No Deathmatch Mode", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(10, 25, 283, 15, "You can enable or disable 'No Deathmatch' mode.", false, GUIEditor.window[1]) GUIEditor.staticimage[1] = guiCreateStaticImage(10, 50, 34, 26, "icon.png", false, GUIEditor.window[1]) GUIEditor.checkbox[1] = guiCreateCheckBox(49, 52, 234, 24, "Enable / Disable No Deathmatch Mode", false, false, GUIEditor.window[1]) guiSetFont(GUIEditor.checkbox[1], "default-bold-small") GUIEditor.button[1] = guiCreateButton(303, 52, 31, 25, "X", false, GUIEditor.window[1]) guiSetVisible(GUIEditor.window[1], false) addEventHandler("onClientGUIClick", GUIEditor.button[1], onGuiClick,false) addEventHandler("onClientGUIClick",GUIEditor.checkbox[1], checkBox, false) end ) addCommandHandler("nodm", function() guiSetVisible(GUIEditor.window[1], true) showCursor(true) end ) function onGuiClick() guiSetVisible(GUIEditor.window[1], false) showCursor(false) end function checkBox() if ( guiCheckBoxGetSelected(GUIEditor.checkbox[1])) then setElementData(localPlayer, "invincible", true) else setElementData(localPlayer, "invincible", false) end end addEventHandler ( "onClientPlayerDamage",localPlayer, function () if getElementData(source,"invincible") then cancelEvent() end end)
  7. Post full code here. i'm pretty sure that you have something wrong
  8. Try it by yourself and we will help you .
  9. it's Wrong. Try this function checkBox() if ( getElementType(source) == "gui-checkbox" ) then if ( guiCheckBoxGetSelected(GUIEditor.checkbox[1])) then setElementData(localPlayer, "invincible", true) else setElementData(localPlayer, "invincible", false) end end end addEventHandler("onClientGUIClick", root, checkBox, false) addEventHandler ( "onClientPlayerDamage",localPlayer, function () if getElementData(source,"invincible") then cancelEvent() end end)
  10. You need to check the player seat , try this function vehicleEntry (playerSource,seat) if seat == 0 then if damageProofPlayers[playerSource] then setVehicleDamageProof(source,true) end end end addEventHandler ("onVehicleEnter", root, vehicleEntry)
  11. it must be like this addEventHandler ( "onClientPlayerDamage",localPlayer, function () if getElementData(localPlayer,"invincible") then cancelEvent() end end)
  12. Walid

    Occupation Save

    You are welcome
  13. Walid

    Occupation Save

    Try to use this function SaveOccupation() local occupation = getElementData(source, "Occupation") or "" local account = getPlayerAccount(source) if account and not isGuestAccount(account) then setAccountData(account,"Occupation",occupation) end end addEventHandler("onPlayerQuit",root,SaveOccupation) function LoadOccupation(_,cur) local occupation = getAccountData(cur, "Occupation") if occupation then setElementData(source,"Occupation",tostring(occupation)) end end addEventHandler("onPlayerLogin",root,LoadOccupation)
  14. Walid

    help

    Killped is server side function. what should i do? use triggerServerEvent()
  15. it's already removed in my code man you are wasting your time read the wiki page before you start scripting , as i told you many things wrong in your code . more than that i'm pretty sure that you are not the owner of this script. simply because getSkinsTable it's not defined in your code so how you want to make the script working without checking the skins category. i will never help you again.
  16. -- Client side GUIEditor = { label = {}, button = {}, window = {}, scrollbar = {}, girldlist = {} } addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(0,0, 328, 496, "Skin Shop v.1.0.0 by Matevsz/teusz0724k", false) guiWindowSetSizable(GUIEditor.window[1], false) centerElement(GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(103, 450, 128, 36, "Zamknij", false, GUIEditor.window[1]) GUIEditor.girldlist[1] = guiCreateGridList(15, 34, 303, 406, false, GUIEditor.window[1]) GUIEditor.scrollbar[1] = guiCreateScrollBar(286, 4, 17, 402, false, false, GUIEditor.girldlist[1]) GUIEditor.label[1] = guiCreateLabel(10, 10, 45, 15, "Nazwa", false, GUIEditor.girldlist[1]) GUIEditor.label[2] = guiCreateLabel(178, 10, 45, 15, "ID", false, GUIEditor.girldlist[1]) GUIEditor.label[3] = guiCreateLabel(6, 15, 276, 15, "_______________________________________", false, GUIEditor.girldlist[1]) guiSetVisible(GUIEditor.window[1], false) addEventHandler("onClientGUIClick", GUIEditor.button[1], function () guiSetVisible(GUIEditor.window[1], false) showCursor(false) setPlayerHudComponentVisible("all", true) setElementModel(localPlayer, Model) setElementFrozen(localPlayer, false) end, false) addEventHandler("onClientGUIDoubleClick", GUIEditor.girldlist[1], WybierzSkina, false) end ) function showSkin(skinsTable) guiGridListClear(GUIEditor.girldlist[1]) setElementFrozen(localPlayer, true) for category, skins in pairs(skinsTable) do local row = guiGridListAddRow(GUIEditor.girldlist[1]) guiGridListSetItemText(GUIEditor.girldlist[1], row, 1, category, true, false) for id, name in pairs(skins) do local row = guiGridListAddRow(GUIEditor.girldlist[1]) guiGridListSetItemText(GUIEditor.girldlist[1], row, 1, name, false, false) guiGridListSetItemText(GUIEditor.girldlist[1], row, 2, id, false, false) end end guiSetVisible(GUIEditor.window[1], true) showCursor(true) model = getElementModel(localPlayer) end addEvent("clothes.showSkin", true) addEventHandler("clothes.showSkin", root, showSkin) function previewSkin() local row = guiGridListGetSelectedItem(GUIEditor.girldlist[1]) if (not row or row == -1) then return end local id = guiGridListGetItemText(GUIEditor.girldlist[1], row, 2) id = tonumber(id) if (not id) then return end setElementModel(localPlayer, id) end function WybierzSkina() local row = guiGirdListGetSelectedItem(GUIEditor.girldlist[1]) if (not row or row == -1) then return end local id = guiGirdListGetItemText(GUIEditor.girldlist[1], row, 2) id = tonumber(id) if (not id) then return end setElementModel(localPlayer, model) setElementFrozen(localPlayer, false) guiSetVisible(GUIEditor.window[1], false) showCursor(false) triggerServerEvent("clothes.WybierzSkina", root, id) end function centerElement(center_window) local screenW,screenH= guiGetScreenSize() local windowW,windowH= guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end -- server local Markerwejscie = createMarker(462,-1500.8000488281,31.60000038147,"arrow",1.20000004,0,0,0,0) local Markerwyjscie = createMarker(207.69999694824,-111.59999847412,1005.9000244141,"arrow",1.20000004,0,0,0,0) local marker = createMarker(207.60000610352,-100.90000152588,1004.299987793,"cylinder",1,255,255,255) 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 == Markerwejscie then setElementPosition(player,207.69999694824,-109.90000152588,1005.0999755859) setElementInterior(player,15) setElementInterior(sprzedawca,15) setElementInterior(Markerwyjscie,15) setElementInterior(marker,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 == Markerwyjscie then setElementPosition(player,459.20001220703,-1500.9000244141,31) 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) addEventHandler("onMarkerHit",marker, function(player, matchingDimension) if (matchingDimension and isElement(player) and getElementType(player) == "player") then local skins = getSkinsTable() triggerServerEvent(player, "clothes.showSkin", player, skins) end end ) You must hi this marker local marker = createMarker(207.60000610352,-100.90000152588,1004.299987793,"cylinder",1,255,255,255) i recommend you to read this Wiki.
  17. I do not know their IDs. I want to change some billboard in Las Venturas use map editor
  18. -- Client GUIEditor = { label = {}, button = {}, window = {}, scrollbar = {}, girldlist = {} } addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(0,0, 328, 496, "Skin Shop v.1.0.0 by Matevsz/teusz0724k", false) guiWindowSetSizable(GUIEditor.window[1], false) centerElement(GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(103, 450, 128, 36, "Zamknij", false, GUIEditor.window[1]) GUIEditor.girldlist[1] = guiCreateGridList(15, 34, 303, 406, false, GUIEditor.window[1]) GUIEditor.scrollbar[1] = guiCreateScrollBar(286, 4, 17, 402, false, false, GUIEditor.girldlist[1]) GUIEditor.label[1] = guiCreateLabel(10, 10, 45, 15, "Nazwa", false, GUIEditor.girldlist[1]) GUIEditor.label[2] = guiCreateLabel(178, 10, 45, 15, "ID", false, GUIEditor.girldlist[1]) GUIEditor.label[3] = guiCreateLabel(6, 15, 276, 15, "_______________________________________", false, GUIEditor.girldlist[1]) guiSetVisible(GUIEditor.window[1], false) addEventHandler("onClientGUIClick", GUIEditor.button[1], function () guiSetVisible(GUIEditor.window[1], false) showCursor(false) setPlayerHudComponentVisible("all", true) setElementModel(localPlayer, Model) setElementFrozen(localPlayer, false) end, false) addEventHandler("onClientGUIDoubleClick", GUIEditor.girldlist[1], WybierzSkina, false) end ) function showSkin(skinsTable) guiGridListClear(GUIEditor.girldlist[1]) setElementFrozen(localPlayer, true) for category, skins in pairs(skinsTable) do local row = guiGridListAddRow(GUIEditor.girldlist[1]) guiGridListSetItemText(GUIEditor.girldlist[1], row, 1, category, true, false) for id, name in pairs(skins) do local row = guiGridListAddRow(GUIEditor.girldlist[1]) guiGridListSetItemText(GUIEditor.girldlist[1], row, 1, name, false, false) guiGridListSetItemText(GUIEditor.girldlist[1], row, 2, id, false, false) end end guiSetVisible(GUIEditor.window[1], true) showCursor(true) model = getElementModel(localPlayer) end addEvent("clothes.showSkin", true) addEventHandler("clothes.showSkin", root, showSkin) function previewSkin() local row = guiGridListGetSelectedItem(GUIEditor.girldlist[1]) if (not row or row == -1) then return end local id = guiGridListGetItemText(GUIEditor.girldlist[1], row, 2) id = tonumber(id) if (not id) then return end setElementModel(localPlayer, id) end function WybierzSkina() local row = guiGirdListGetSelectedItem(GUIEditor.girldlist[1]) if (not row or row == -1) then return end local id = guiGirdListGetItemText(GUIEditor.girldlist[1], row, 2) id = tonumber(id) if (not id) then return end setElementModel(localPlayer, model) setElementFrozen(localPlayer, false) guiSetVisible(GUIEditor.window[1], false) showCursor(false) triggerServerEvent("clothes.WybierzSkina", root, id) triggerServerEvent("clothes.WybierzSkina", root, id) end function PokazGui(player) guiGetVisible(GUIEditor.window[1], true) showCursor(true) end addEvent("PokazGui", true) addEventHandler("PokazGui", root, PokazGui) function centerElement(center_window) local screenW,screenH= guiGetScreenSize() local windowW,windowH= guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end -- Server local Markerwejscie = createMarker(462,-1500.8000488281,31.60000038147,"arrow",1.20000004,0,0,0,0) local Markerwyjscie = createMarker(207.69999694824,-111.59999847412,1005.9000244141,"arrow",1.20000004,0,0,0,0) local marker = createMarker(207.60000610352,-100.90000152588,1004.299987793,"cylinder",1) 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 == Markerwejscie then setElementPosition(player,207.69999694824,-109.90000152588,1005.0999755859) setElementInterior(player,15) setElementInterior(sprzedawca,15) setElementInterior(Markerwyjscie,15) setElementInterior(marker,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 == Markerwyjscie then setElementPosition(player,459.20001220703,-1500.9000244141,31) 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) end end addEventHandler("onMarkerHit",marker, function(hitElement,matchingDimension) if matchingDimension and isElement(hitElement) and getElementType(hitElement) == "player" then triggerClientEvent(hitElement,"PokazGui",hitElement) end end )
  19. Many things wrong in your code anyways this should work GUIEditor = { label = {}, button = {}, window = {}, scrollbar = {}, girldlist = {} } addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(1281, 255, 328, 496, "Skin Shop v.1.0.0 by Matevsz/teusz0724k", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(103, 450, 128, 36, "Zamknij", false, GUIEditor.window[1]) GUIEditor.girldlist[1] = guiCreateGridList(15, 34, 303, 406, false, GUIEditor.window[1]) GUIEditor.scrollbar[1] = guiCreateScrollBar(286, 4, 17, 402, false, false, GUIEditor.girldlist[1]) GUIEditor.label[1] = guiCreateLabel(10, 10, 45, 15, "Nazwa", false, GUIEditor.girldlist[1]) GUIEditor.label[2] = guiCreateLabel(178, 10, 45, 15, "ID", false, GUIEditor.girldlist[1]) GUIEditor.label[3] = guiCreateLabel(6, 15, 276, 15, "_______________________________________", false, GUIEditor.girldlist[1]) guiSetVisible(GUIEditor.window[1], false) addEventHandler("onClientGUIClick", GUIEditor.button[1], function() guiSetVisible(GUIEditor.window[1], false) showCursor(false) setPlayerHudComponentVisible("all", true) setElementModel(localPlayer, Model) setElementFrozen(localPlayer, false) end, false) addEventHandler("onClientGUIClick", GUIEditor.girldlist[1], previewSkin, false) addEventHandler("onClientGUIDoubleClick", GUIEditor.girldlist[1], WybierzSkina,false) end ) function showSkin(skinsTable) guiGridListClear(GUIEditor.girldlist[1]) setElementFrozen(localPlayer, true) for category, skins in pairs(skinsTable) do local row = guiGridListAddRow(GUIEditor.girldlist[1]) guiGridListSetItemText(GUIEditor.girldlist[1], row, 1, category, true, false) for id, name in pairs(skins) do local row = guiGridListAddRow(GUIEditor.girldlist[1]) guiGridListSetItemText(GUIEditor.girldlist[1], row, 1, name, false, false) guiGridListSetItemText(GUIEditor.girldlist[1], row, 2, id, false, false) end end guiSetVisible(GUIEditor.window[1], true) showCursor(true) model = getElementModel(localPlayer) end addEvent("clothes.showSkin", true) addEventHandler("clothes.showSkin", root, showSkin) function previewSkin() local row = guiGridListGetSelectedItem(GUIEditor.girldlist[1]) if (not row or row == -1) then return end local id = guiGridListGetItemText(GUIEditor.girldlist[1], row, 2) id = tonumber(id) if (not id) then return end setElementModel(localPlayer, id) end function WybierzSkina() local row = guiGirdListGetSelectedItem(GUIEditor.girldlist[1]) if (not row or row == -1) then return end local id = guiGirdListGetItemText(GUIEditor.girldlist[1], row, 2) id = tonumber(id) if (not id) then return end setElementModel(localPlayer, model) setElementFrozen(localPlayer, false) guiSetVisible(GUIEditor.window[1], false) showCursor(false) triggerServerEvent("clothes.WybierzSkina", root, id) triggerServerEvent("clothes.WybierzSkina", root, id) end
  20. Try this GUIEditor = { label = {}, button = {}, window = {}, scrollbar = {}, girldlist = {} } addEventHandler("onClientResourceStart",resourceRoot, function gui() GUIEditor.window[1] = guiCreateWindow(1281, 255, 328, 496, "Skin Shop v.1.0.0 by Matevsz/teusz0724k", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(103, 450, 128, 36, "Zamknij", false, GUIEditor.window[1]) GUIEditor.girldlist[1] = guiCreateGridList(15, 34, 303, 406, false, GUIEditor.window[1]) GUIEditor.scrollbar[1] = guiCreateScrollBar(286, 4, 17, 402, false, false, GUIEditor.girldlist[1]) GUIEditor.label[1] = guiCreateLabel(10, 10, 45, 15, "Nazwa", false, GUIEditor.girldlist[1]) GUIEditor.label[2] = guiCreateLabel(178, 10, 45, 15, "ID", false, GUIEditor.girldlist[1]) GUIEditor.label[3] = guiCreateLabel(6, 15, 276, 15, "_______________________________________", false, GUIEditor.girldlist[1]) guiSetVisible(GUIEditor.window[1], false) addEventHandler("onClientGUIClick", GUIEditor.button[1], function() guiSetVisible(GUIEditor.window[1], false) showCursor(false) setPlayerHudComponentVisible("all", true) setElementModel(localPlayer, Model) setElementFrozen(localPlayer, false) end, false) addEventHandler("onClientGUIClick", GUIEditor.girldlist[1], previewSkin, false) addEventHandler("onClientGUIDoubleClick", GUIEditor.girldlist[1], WybierzSkina,false) end ) addEventHandler("onClientResourceStart", resourceRoot, gui) function showSkin(skinsTable) guiGridListClear(GUIEditor.girldlist[1]) setElementFrozen(localPlayer, true) for category, skins in pairs(skinsTable) do local row = guiGridListAddRow(GUIEditor.girldlist[1]) guiGridListSetItemText(GUIEditor.girldlist[1], row, 1, category, true, false) for id, name in pairs(skins) do local row = guiGridListAddRow(GUIEditor.girldlist[1]) guiGridListSetItemText(GUIEditor.girldlist[1], row, 1, name, false, false) guiGridListSetItemText(GUIEditor.girldlist[1], row, 2, id, false, false) end end guiSetVisible(GUIEditor.window[1], true) showCursor(true) model = getElementModel(localPlayer) end addEvent("clothes.showSkin", true) addEventHandler("clothes.showSkin", root, showSkin) function previewSkin() local row = guiGridListGetSelectedItem(GUIEditor.girldlist[1]) if (not row or row == -1) then return end local id = guiGridListGetItemText(GUIEditor.girldlist[1], row, 2) id = tonumber(id) if (not id) then return end setElementModel(localPlayer, id) end function WybierzSkina() local row = guiGirdListGetSelectedItem(GUIEditor.girldlist[1]) if (not row or row == -1) then return end local id = guiGirdListGetItemText(GUIEditor.girldlist[1], row, 2) id = tonumber(id) if (not id) then return end setElementModel(localPlayer, model) setElementFrozen(localPlayer, false) guiSetVisible(GUIEditor.window[1], false) showCursor(false) triggerServerEvent("clothes.WybierzSkina", root, id) triggerServerEvent("clothes.WybierzSkina", root, id) end
  21. Walid

    Dual wield flag

    try to use sth like that -- Example AK-47 setWeaponProperty(30, "pro", "flags", 2048) setWeaponProperty(30, "pro", "flags", 2)
  22. it's server side code, replace /stop with any other command it's just an example.
  23. Walid

    [TUT] Lua Tables

    Simply : * ipairs: loop only number indexes "start from 1 index" and only in order. * pairs: Loop all. for more information check Solidsnake14 link
×
×
  • Create New...