Jump to content

TAPL

Retired Staff
  • Posts

    7,337
  • Joined

  • Days Won

    11

Everything posted by TAPL

  1. TAPL

    Need double help

    Fixed, copy my code again.
  2. TAPL

    Need double help

    Try function playerList() Column = guiGridListAddColumn(Grid, "Player", 0.85) if (Column) then for _, player in ipairs (getElementsByType("player")) do local Row = guiGridListAddRow(Grid) guiGridListSetItemText (Grid, Row, Column, getPlayerName(player):gsub("#%x%x%x%x%x%x", ""), false, false) end end end addEventHandler("onClientResourceStart", resourceRoot, playerList) function updateList(old, new) if eventName == "onClientPlayerJoin" then local i = guiGridListAddRow(Grid) guiGridListSetItemText(Grid, i, Column, getPlayerName(source):gsub("#%x%x%x%x%x%x", ""), false, false) elseif eventName == "onClientPlayerQuit" then for i=0, guiGridListGetRowCount(Grid) do if guiGridListGetItemText(Grid, i, Column) == getPlayerName(source):gsub("#%x%x%x%x%x%x", "") then guiGridListRemoveRow(Grid, i) end end elseif eventName == "onClientPlayerChangeNick" then for i=0, guiGridListGetRowCount(Grid) do if guiGridListGetItemText(Grid, i, Column) == old then guiGridListSetItemText(Grid, i, Column, new, false, false) end end end end addEventHandler("onClientPlayerJoin", root, updateList) addEventHandler("onClientPlayerQuit", root, updateList) addEventHandler("onClientPlayerChangeNick", root, updateList)
  3. TAPL

    Need double help

    It's updated every 2 seconds, there's nothing stopping from select anything. Try to select anything and after 2 second, you will lose what you select and the scroll bar will back to top again.
  4. TAPL

    Need double help

    You shouldn't use timer, if you use timer and clear the grid list and then re add the rows, you will not be able to select anything in the grid list. You should update the grid list with events onClientPlayerJoin and onClientPlayerQuit and onClientPlayerChangeNick.
  5. TAPL

    How to put.....

    Did you read the wiki link that i have given you in the other topic? i'll give you the same link again https://wiki.multitheftauto.com/wiki/Server_Manual take a look at the contents, i hope this time you will read it all.
  6. Use this event with cancelEvent https://wiki.multitheftauto.com/wiki/OnClientPedDamage
  7. TAPL

    Boolen

    guiCreateLabel return element not string. Should be: guiSetText( player_name, guiGetText(player_name2) ) here source is not defined, use localPlayer instead of source. player_name2 = guiCreateLabel( 0.325, 0.1, 0.2, 0.2, "PlayerName: ".. getPlayerName(source), true, Wnd )
  8. TAPL

    Any way?

    The timer here will cause for you a problems, the grid list will be created over and over you will notice that your fps will be low because of this. setTimer( playerList, 100, 0 ) and the event addEventHandler("onClientResourceStart", root, playerList) should be addEventHandler("onClientResourceStart", resourceRoot, playerList)
  9. TAPL

    Help with script

    No event? then how function playerList is executed?
  10. TAPL

    Help with script

    This is full code?
  11. You're welcome.
  12. You're welcome.
  13. Wrong section?
  14. TAPL

    Blip Color

    This make no sense.
  15. bindKey("lshift","down", function () local veh = getPedOccupiedVehicle(getLocalPlayer()); if (veh and isVehicleOnGround(veh)) then local vx,vy,vz = getElementVelocity(veh); setElementVelocity(veh, vx, vy, vz + 0.5); end end ); If not work, post your meta.xml
  16. https://forum.multitheftauto.com/viewtopic.php?f=119&t=46411&p=462104#p462110
  17. function hi(player) outputChatBox("* #ff2400"..getPlayerName(player).." #797979Joined The Server And Wanne Say Hi To You All", root, 255, 255, 255, true) end addCommandHandler("hi", hi)
  18. TAPL

    How to make......

    it's look you are in wrong folder You should be in 'server/mods/deathmatch/mtaserver.conf'
  19. https://wiki.multitheftauto.com/wiki/IsTransferBoxActive
  20. The BaseMode has their way to get the Alive players, the Alive player has element data the teams also has element data, but i don't remember the team one, also this can be done in another way. Try this local poisonTeam = getTeamFromName("Poison") local ninjaTeam = getTeamFromName("Ninja") function Winning () local poisonPlayers = #getAlivePlayersInTeam(poisonTeam) or 0 local ninjaPlayers = #getAlivePlayersInTeam(ninjaTeam) or 0 if (ninjaPlayers == 0) then outputChatBox("Poison Team won the round!", root, 255, 25, 0) elseif (poisonPlayers == 0) then outputChatBox("Ninja Team won the round!", root, 255, 25, 0) elseif (poisonPlayers == 0 and ninjaPlayers == 0) then outputChatBox("#00ff00[#ffffffThe round was a tie!#00ff00]", root, 255, 255, 255, true) end end addEventHandler("onPlayerWasted", root, Winning) function getAlivePlayersInTeam(theTeam) local theTable = { } local players = getPlayersInTeam(theTeam) for i,v in pairs(players) do if getElementData(v, "IsSpawned") ~= 1 then theTable[#theTable+1]=v end end return theTable end
  21. TAPL

    Show marker !!

    You want it for other jobs, other jobs by meaning is taking a job that aren't Medic for this you need to change the event "setMedic" function leaveMedic() if isElementVisibleTo(ambulancee, source) then setElementVisibleTo(ambulancee, source, false) end end addEventHandler("setMedic",root,leaveMedic)
  22. TAPL

    How to make......

    You don't know how to make a server? Here you go: https://wiki.multitheftauto.com/wiki/Server_Manual You want make New maps? Here you go: https://wiki.multitheftauto.com/wiki/Resource:Editor You want make the gate (open/close)? Here you go: https://wiki.multitheftauto.com/wiki/MoveObject
  23. TAPL

    Show marker !!

    When you take other job, use this if isElementVisibleTo(ambulancee, source) then setElementVisibleTo(ambulancee, source, false) end
×
×
  • Create New...