Jump to content

xXGhostXx

Members
  • Posts

    257
  • Joined

  • Last visited

Everything posted by xXGhostXx

  1. No i want when use this function player name field if several similar names are found, they should be in the table.
  2. Hello, i want find player with similar names and print names in a list ! My find player function : function findPlayer( partofname ) local player = getPlayerFromName ( tostring(partofname) ) if player then return player end for _, player in pairs( getElementsByType 'player' ) do if tonumber(getElementData(player,"id")) == tonumber(partofname) then if getElementData(player, "loggedIn") == true then return player end end end for _, player in pairs( getElementsByType 'player' ) do if string.find ( string.gsub ( getPlayerName ( player ):lower( ), "#%x%x%x%x%x%x", "" ), partofname:lower( ), 1, true ) then if getElementData(player, "loggedIn") == true then return player end end end end Do you have an idea or opinion ?
  3. Hi guys. What's problem in my code ? local Weapons = { { 22, 24, 25, 26, 27, 28, 29, 30, 31, 34 }, } function getWeaponSlotFromID (Weapon) local slot = 0 for i=1,10 do if Weapons[1][i] == Weapon then slot = i end end return slot end I want to give a weapon id and get the slot in the table .
  4. Hi guys. How can i customize default name tag in mta sa. i want add player id under player name. I want this :
  5. Does not count, because i want know. for example i use elementData. Please answer me.
  6. Hello guys. I want idea for get the largest player money on server. Please help me.
  7. Hi guys. I trying to make html loading page but i don't know how can i load html page on player connect to server for when loading server data. like: FiveM Guys please make simple code for this with html. thanks.
  8. I want on player join in my server when data loading play this html page
  9. Don't work. Meta: <meta> <script src="Loading.Lua" type="client" /> <file src="index.html" /> <download_priority_group>1</download_priority_group> </meta> Client: local screen = {guiGetScreenSize()} local page = "http://mta/local/index.html" function downloadGUI() browser = guiCreateBrowser(0,0,screen[1],screen[2],true,true,false) --display the Browser bg = guiGetBrowser(browser) addEventHandler("onClientBrowserCreated", bg, function() loadBrowserURL(source, page) end) end addEventHandler("onClientRender", root, downloadGUI) function checkTransfer() if isTransferBoxActive() == true then setTimer(checkTransfer,2000,1) -- Check again after 2 seconds else removeEventHandler("onClientRender", root, downloadGUI) end end addEventHandler("onClientResourceStart",resourceRoot,checkTransfer)
  10. Hi guys. How can i make loading screen on player loading server data like FiveM ?
  11. Your code is working but i want add allowing characters in table.
  12. Working because i want add allowing characters in table.
  13. Hi guys. I try to use string.find with table. characters = { ["a"] = true, ["b"] = true, ["c"] = true, } function test (username) if string.find(username, characters[username]) then else outputChatBox("This is invalid character!",source) end end What is my problem ?
  14. function clickSound () local sound = playSound("click.mp3") end addEventHandler("onClientClick", getRootElement(), clickSound) This is true ?
  15. Hi guys. Do you have a idea for add sound for on client click event ?
  16. Hi guys. Do you have a idea for make Heist system for bank robbery or ... like: Player can make party with /party command and /invite 3 players for make robbery group. Heist system have 4 number slots with party leader. After /invite a player name triggered to gui and set the text. After it's done bank robbery for party members and leaders set wanted to 6. Please give me a idea and function and method. Thanks all.
  17. Thanks you can give me table for this code ?
  18. Yes i fixed but i want police faction respawn police cars. FBI faction respawn fbi cars. or ... addCommandHandler("rv", function (player, command) local vehicles = getElementsByType("vehicle") for i = 1, #vehicles do local vehicle = vehicles[i] if vehicle then local vehid = getElementID(vehicle) local faction = getElementData(player, "faction") if facVehsTable[vehid] and facVehsTable[vehid][faction] then respawnVehicle(vehicle) end end end end) In this code i want get my faction and find in the table my faction id and get the car and respawn car geted!
  19. Dear i want if you are police faction you can respawn police cars or if you are medic faction respawn medic cars with /rv command ! And "local faction = getElementData(player, "faction")" for get my faction for respawn my faction cars
  20. Thanks for your help. I have a problem. I trying to make respawn faction vehicles. For example: i am police officer and i want respawn my faction cars or i am medic and i want respawn my faction cars. addCommandHandler("rv", function(thePlayer, command) for index, Fac_Cars in ipairs(getElementsByType("vehicle")) do local vehid = getElementID(Fac_Cars) local faction = getElementData(thePlayer, "faction") if facVehsTable[vehid] then respawnVehicle(Fac_Cars) end end end) What is problem ?
×
×
  • Create New...