-
Posts
7,337 -
Joined
-
Days Won
11
Everything posted by TAPL
-
https://forum.multitheftauto.com/viewtopic.php?f=119&t=49609
-
Yes, since getPlayersInTeam and getElementHealth available client/server side, it should work.
-
function getTeamHealth(team) if team then HP = 0 for i, player in ipairs(getPlayersInTeam(team)) do HP = HP + getElementHealth(player) end return HP end end Use it with event onPlayerJoin and onPlayerQuit and onPlayerDamage or a timer or whatever.
-
Only these what you need to edit You already have them commented. -- Settings for when a player joins -- XYZ coördinates local joinX = -2462.3999023438 local joinY = 132.69999694824 local joinZ = 35.200000762939 -- Weapon and ammo local joinWeapon = 0 local joinAmmo = 0 -- Message when player joins local joinMessage = "Welcome to Belgium-Reallife." -- Skin that player gets local joinSkin = 0 -- Settings for when a player dies -- XYZ coördinates local spawnX = -2462.3999023438 local spawnY = 132.69999694824 local spawnZ = 35.200000762939 -- Weapon and ammo local spawnWeapon = 0 local spawnAmmo = 0 -- Skin that player gets local spawnSkin = 0 -- Settings for the amounts of money -- Money the killer gets local killerMoney = 0 -- Money removed from player when they die local deadPlayerMoney = 0 -- Money you get when you join local joinMoney = 0
-
How will thesurvivor be selected, i mean how you will make the script select thesurvivor? What about if thesurvivor dead before everyone? -- Server Side -- -- thesurvivor should be defined somewhere. addEventHandler("onPlayerWasted", root, function() local alivePlayers = getAlivePlayers() if source == thesurvivor then -- thesurvivor dead, do something.. elseif #alivePlayers == 1 and alivePlayers[1] == thesurvivor then -- everyone dead, except thesurvivor. for i, player in ipairs(getElementsByType("player")) do -- get all players. spawnPlayer(player, x, y, z) -- spawn all players. setCameraTarget(player) -- make the camera follow him. end end end)
-
عندك قوس زايد في سطر 9 الكلينت
-
What do you mean by class?
-
Not sure, but i think you need this: dxDrawImageSection
-
-- Client Side -- Window = guiCreateWindow(583, 409, 197, 327, "Fake Cars", false) guiWindowSetSizable(Window, false) guiSetVisible(Window, false) obutton = guiCreateButton(9, 96, 117, 33, ":O", false, Window) Perennial = guiCreateButton(9, 131, 117, 35, "Perennial", false, Window) Walton = guiCreateButton(9, 169, 118, 34, "Walton", false, Window) Tampa = guiCreateButton(9, 206, 118, 34, "Tampa", false, Window) AutoWahlenLabel = guiCreateLabel(30, 57, 139, 15, "Bitte wähle ein Auto aus", false, Window) Abbrechen = guiCreateButton(10, 288, 177, 29, "Abbrechen", false, Window) OderMochtestDu = guiCreateLabel(39, 269, 117, 15, "Oder möchtest du...", false, Window) lable1 = guiCreateLabel(131, 104, 52, 15, "500$", false, Window) guiLabelSetColor(lable1, 23, 132, 5) PerennialPreis = guiCreateLabel(131, 141, 53, 15, "2000$", false, Window) guiLabelSetColor(PerennialPreis, 23, 132, 5) WaltonPreis = guiCreateLabel(132, 181, 55, 15, "1500$", false, Window) guiLabelSetColor(WaltonPreis, 23, 132, 5) TampaPreis = guiCreateLabel(131, 218, 56, 15, "750$", false, Window) guiLabelSetColor(TampaPreis, 23, 132, 5) function Fake_Cars_show() local IsWindowVisible = guiGetVisible(Window) if (IsWindowVisible == true) then guiSetVisible(Window, false) guiSetInputEnabled(false) elseif (IsWindowVisible == false) then guiSetVisible(Window, true) guiSetInputEnabled(true) end end local myMarker = createMarker(-2615, 2262, 7.3, "cylinder", 1.0, 255, 0, 0, 150) addEventHandler("onClientMarkerHit", myMarker, function(player) if getElementType(player) == "player" and player == localPlayer then Fake_Cars_show() end end) function Buttons(state) if state == "left" then if source == Abbrechen then Fake_Cars_show() end end end addEventHandler("onClientGUIClick", root, Buttons) There no need for server side.
-
Ok, send it at Private Message.
-
Have you tried change the event name "openGUI" to something else?
-
It depends on how you want it to work, the example is simply will add the sirens to any vehicle you enter and it will be removed from the vehicle when you exit from it, that all. You just need to create new resource, and copy - paste the example, and be sure it must be server side.
-
Vehicle = createVehicle(id, x, y, z) -- id is not defined.
-
local mapName = getMapName(source) -- read wiki, this function not need argument. x, y, z = getElementPosition(source), source, 50000 -- what is this? lol setTimer(function() destroyElement(source, Vehicle) end, 300000, 1, true) should be: setTimer(function(source) destroyElement(source, Vehicle) end, 300000, 1, source) And as manve1 said about the outputChatBox.
-
Did you put it server side in meta? Are you sure that your data name is "wins"?
-
addEventHandler("onPlayerQuit", root, function() local account = getPlayerAccount(source) if (account) and not isGuestAccount(account) then local wins = getElementData(source, "wins" ) or 0 setAccountData(account, "flatout.wins", wins) end end) addEventHandler("onPlayerLogin", root, function(_, account) local wins = getAccountData(account, "flatout.wins") or 0 if (wins) then setElementData(source, "wins", wins) end end)
-
Your problem is that the GUI is showing for everyone, not only for who has hit the col? Well, the trigger is only for who hit the col, so the problem is no problem. Maybe you want post the rest of the code? Where is the function eschrankefunc () ? Maybe you have other script trigger the event openGUI for everyone? try to change it to something else.
