-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
Try something like this. toggleControl("forwards",false) toggleControl("backwards",false) local converterToBoolean = {["down"]=false,["up"]=true} local controlManagement = function (key,state) setControlState(key,converterToBoolean[state]) end bindKey("forwards","both",controlManagement) bindKey("backwards","both",controlManagement)
-
oh lol Thanks!
-
bindKey("x","down",function () for _,v in pairs ( items ) do local object = createObject ( 929, v[1], v[2], v[3] ) end end)
-
Hey, I am trying to make a label text fit able, but I am ending up at an infinity loop. Anybody has a solution? local maxLabelSizeTable = {40,40,40,40,40} local makeTextFitForGrid = function (element,index) local text = guiGetText ( element ) local size = guiLabelGetTextExtent ( element ) outputChatBox(size) local maxSize = maxLabelSizeTable[index] if size > maxSize then repeat guiSetText( element,string.sub(text,1,-2)) size = guiLabelGetTextExtent ( element ) until maxSize > size local text = guiGetText ( element ) guiSetText( element, text .. "..") end end
-
np.
-
function saytext(thePlayer, command,argument) if argument then local player = getPlayerFromNamePart(argument) if player then outputChatBox ( "[ " .. getPlayerName(thePlayer).. " ] is laughing out loud at " .. getPlayerName(player) .. "!", root, 255, 0, 0, true) end else outputChatBox ("Player is laughing out loud!") end end addCommandHandler ( "lol", saytext )
-
Maybe, - The message contains the name of the one that wrote the command or the name of the target? - Message must be send to everybody? function saytext(thePlayer, command,argument) local player = getPlayerFromNamePart(argument) if player then outputChatBox ( "[ " .. getPlayerName(thePlayer).. " ] is laughing out loud at " .. getPlayerName(player) .. "!", root, 255, 0, 0, true) end end addCommandHandler ( "lol", saytext )
-
True, but that is just 1 loop. If you use it in 20 times in one 1 script. And you have 10 scripts. And then you have 200 loops and yes that is still nothing for cpu's of these times. (only for players that have bad pc's) But ask your self: "why write more lines then you need?" You probably will answer: "I love to write lua....."
-
You didn't forget to add: function getPlayerFromNamePart(name) if name then for i, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then return player end end end return false end
-
True, but it would be a waste of your memory since you only use it for counting.
-
function saytext(thePlayer, command,argument) local player = getPlayerFromNamePart(argument) if player then outputChatBox ( "[ "..getPlayerName(player).." ] is laughing out loud!", root, 255, 0, 0, true) end end addCommandHandler ( "lol", saytext )
-
outputChatBox(#getElementsWithinColShape ( colShape, "player" ) )
-
objects are in the same dimension and interior?
-
myTable = {"Anubhav","IIYAMA","MTA","moderators", "super moderators", "admins"} --Is same as: myTable = { [1]="Anubhav", [2]="IIYAMA", [3]="MTA", [4]="moderators", [5]="super moderators", [6]="admins" } -- [1] is index number 1, defines the location of the information in a table. outputChatBox("test: " .. myTable[1]) --Anubhav outputChatBox("test: " .. myTable[2]) --IIYAMA outputChatBox("test: " .. myTable[3]) --MTA ----------------------------- for k,v in ipairs(myTable) do -- loop outputChatBox("index: " .. k .. ", Content: " .. v ) outputChatBox(v)--****** end Is same as:****** outputChatBox("Anubhav") outputChatBox("IIYAMA") outputChatBox("MTA") outputChatBox("moderators") outputChatBox("super moderators") outputChatBox("admins")
-
As far as I know, I helped you with a piece of code, I showed you were to start with scripting and I was the only person that was trying to help you. And still with disrespect? Pathetic little kid that you are.
-
Sorry, but you first need to learn the basic from lua. This isn't worth my time by writing all sample codes, when you can't learn anything from that because you don't know the laughing. Try to make simple things, like wiki mta samples. I will recommend you to leave this project until you are ready for it. and don't tell me you are, because we both know that isn't true.
-
when do you want him to spawn? P.s: the code you are showing to me is useless in your case.
-
local mySpawnTable = { {331.06286621094, 1855.9083251953, 7.828125}, -- fill in pls..... {216.45199584961, 1822.6893310547, 6.4140625}, --<-- {211.66558837891, 1810.6231689453, 21.8671875} -- <-- } Seriously was that so hard? By just filling it in..... If you don't understand it, then you know how to solve that problem. And it starts with: L . . R . . NG
-
local mySpawnTable = { {0,0,0}, -- fill in pls..... {0,0,0}, --<-- {0,0,0} -- <-- } function makePlayerSpawn (player) local spawnPoint = mySpawnTable[math.random(#mySpawnTable)] -- random spawnpoint spawnPlayer(player,spawnPoint[1],spawnPoint[2],spawnPoint[3]) end You can decide when he should spawn, that is up to you.
-
local font = dxCreateFont("font.ttf") ----------- dxDrawText( title, x, 0, x + width, y + 18, tocolor( tcolor[1], tcolor[2], tcolor[3], tcolor[4] * alpha ), 0.6, font, "left", "top", true, true, true ) Also make sure, the file is written in the meta.xml
-
https://wiki.multitheftauto.com/wiki/OnVehicleEnter https://wiki.multitheftauto.com/wiki/OnVehicleExit https://wiki.multitheftauto.com/wiki/Re ... romVehicle To lazy to search on wiki mta?
-
lol! Well, good that you found the problem, because it would be a nasty one to debug.
-
np.
-
Are you out side of the gta bounding box when this happens? 3000 x 3000 units. Because those bugs are also because of that.
