-
Posts
1,248 -
Joined
-
Last visited
Everything posted by WhoAmI
-
Why won't you use myonlake code?
-
Well, you mean playSound, or playSound3D? Couse your code is strange.
-
If you created button, add function which will have been done when you click this button. And in this function just stop the sound.
-
function resourceStart () for k,v in ipairs(getElementsByType("player")) do bindKey (v,"F3", "down", openhelpacs) end end addEventHandler("onResourceStart", resourceRoot, resourceStart)
-
Function added to event onClientGUIClick, and there destroyElement or stopSound.
-
local sound = playSound("login.mp3", true)
-
Well I wrote you how, but... addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do -- Loop all the players. bindKey ( player, "U", "down", "chatbox", "gangChat" ) -- Bind the key "U" to the "GangChat" command. end end ) addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "U", "down", "chatbox", "gangChat" ) -- Bind the key "U" to the "GangChat" command. end ) function gangChat ( thePlayer, _, ... ) local isInvited = getElementData ( thePlayer, "invited" ) or false if ( isInvited ) then local text = table.concat ( { ... }, " " ) if ( #text > 0 ) then outputChatBox ("#FF32AA (GANG) "..getPlayerName(thePlayer)..": #FFFFFF" ..text, thePlayer, 255, 255, 255, true ) end end end addCommandHandler ( "gangChat", gangChat ) function invitePlayer ( thePlayer, _, playerName ) if not playerName then return end local playerToInvite = getPlayerFromName(playerName) if ( isElement ( playerToInvite ) ) then setElementData ( playerToInvite, "invited", true ) outputChatBox ( "You have been invited to the chat.", playerToInvite) else outputChatBox ( "There is no such a player!", thePlayer ) end end addCommandHandler ( "invite", invitePlayer )
-
Lol no! Setelementdata, thats all. For example. addCommandHandler("invite", function (player, cmd, name) if not name then return end setElementData(getPlayerFromName(name), "invited", true) end ) And then you are just checking if (getElementData(player, "invited") then
-
Then you dxDrawText and tables.
-
Mximal dimension is about 65k.
-
function sayHandler(...) message = table.concat({...}, " ") local sender = getPlayerName(source) local posX, posY, posZ = getElementPosition(source) local saySphere = createColSphere( posX, posY, posZ, sayRadius ) local nearbyPlayers = getElementsWithinColShape( saySphere, "player" ) destroyElement( saySphere ) for index, nearbyPlayer in ipairs( nearbyPlayers ) do outputChatBox(sender.." dit : "..message, nearbyPlayer, 255, 255, 255, true) end end addEventHandler( "onPlayerChat", getRootElement(), sayHandler ) Try this.
-
function key () triggerServerEvent("onPlayerRequestFix", getLocalPlayer()) end addEventHandler ( "onClientResourceStart", getRootElement(), function() local gTeam = getPlayerTeam(localPlayer) local StuntageTeam = getTeamFromName("Stuntage Arena") if ( gTeam and StuntageTeam and gTeam == StuntageTeam ) then bindKey("R","down", key) else unbindKey(source,"R","down", key) end end ) Anyway, can't you do like this? function name () if (isPedInVehicle (source)) then theVehicle = getPedOccupiedVehicle(source) fixVehicle(theVehicle) else cancelEvent() end end ) for k,v in ipairs (getElementsByType("players")) do bindKey(v, "R", down, name) end
-
Use missiontimer resource. https://wiki.multitheftauto.com/wiki/Re ... ssiontimer
-
Copy again. I tested it, and It works. addEventHandler( "onClientRender", root, function( ) local peds = getElementsByType("ped") if (#peds > 0) then local x,y,z = getElementPosition(localPlayer) for k,ped in ipairs(peds) do if (getElementData(ped, "robberped")) then local pX,pY,pZ = getElementPosition(ped) --ped's position local tX,tY,tZ = pX,pY,pZ+1 --text's position local maxDistance = 30 local distance = getDistanceBetweenPoints3D(x, y, z, tX, tY, tZ) if (distance <= maxDistance) then local wX, wY = getScreenFromWorldPosition(tX, tY, tZ) if (wX and wY) then dxDrawText("Robber Job", wX + 2, wY + 2, _, _, tocolor(0, 0, 0, 200), 2, "arial", "center", "center") dxDrawText("Robber Job", wX, wY, _, _, tocolor(0, 255, 0, 200), 2, "arial", "center", "center") end end end end end end )
-
local x,y = guiGetScreenSize() local image = guiCreateStaticImage( 0, 0, x, y, "login_bg.jpeg", false ) guiMoveToBack(image)
-
addEventHandler( "onClientRender", root, function( ) local peds = getElementsByType("ped") if (#peds > 0) then local x,y,z = getElementPosition(localPlayer) for k,ped in ipairs(peds) do if (getElementData(ped, "robberped")) then local pX,pY,pZ = getElementPosition(ped) --ped's position local tX,tY,tZ = pX,pY,pZ+1 --text's position local maxDistance = 30 local distance = getDistanceBetweenPoints3D(x, y, z, tX, tY, tZ) if (distance <= maxDistance) then local wX, wY = getScreenFromWorldPosition(tX, tY, tZ) if (wX and wY) then dxDrawText("Robber Job", wX + 2, wY + 2, _, _, tocolor(0, 0, 0, 200), 2, "arial", "center", "center") dxDrawText("Robber Job", wX, wY, _, _, tocolor(0, 255, 0, 200), 2, "arial", "center", "center") end end end end end end ) It works.
-
Don't know if it will work, couse I didn't test it, but... addEventHandler( "onClientRender", root, function( ) local peds = getElementsByType("ped") if (#peds > 0) then for _,ped in ipairs(peds) do if (getElementData(ped, "robberped")) then local pX,pY,pZ = getElementPosition(ped) --ped's position local tX,tY,tZ = pX,pY,pZ+1 --text's position local x,y,z = getElementPosition(localPlayer) --player's position local maxDistance = 30 local distance = getDistanceBetweenPoints3D(x, y, z, tX, tY, tZ) if (distance <= maxDistance) then local wX, wY = getScreenFromWorldPosition(tX, tY, tZ) if (wX and wY) then dxDrawText("Robber Job", wX + 2, wY + 2, _, _, tocolor(0, 0, 0, 200), 2, "arial", "center", "center") dxDrawText("Robber Job", wX, wY, _, _, tocolor(0, 255, 0, 200), 2, "arial", "center", "center") end end end end end end ) And serverside function robberPed () local ped = createPed ( 19, 2054.4609375, -1760.5224609375, 13.546875 ) setElementData(ped, "robberped", true) setElementFrozen ( ped, true ) end addEventHandler ( "onResourceStart", resourceRoot, robberPed )
-
Well, how did u defined 'p' in serverside script?
-
addCommandHandler("setexp", function(player,cmd,exp) local accountName = getAccountName ( getPlayerAccount ( player ) ) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then if not tonumber(exp) then return end setElementData(player, "exp", tonumber(exp)) end end)
-
Błąd z systemem PM/PW na ID
WhoAmI replied to aski's topic in Pomoc ze skryptami i programowaniem w Lua
Ten skrypt jest ściśle powiązany z gamemodem. Między innymi kara blokady pm, postacie. Musiałbyś się pobawić, żeby to przerobić.