Jump to content

IIYAMA

Moderators
  • Posts

    6,085
  • Joined

  • Last visited

  • Days Won

    215

Everything posted by IIYAMA

  1. local playerDataTable = { {"torso"} } --too: local playerDataTable = { "torso"--, --"stuff" } setAccountData(account, data[1], "\""..tex.."\",\""..mod.."\"") --Too: setAccountData(account, data, tex..",".. mod .. "," .. clothesType) addPedClothes (player, getAccountData(account, data[1]), 0) --Too: local clothing = getAccountData(account, data) if clothing and getElementModel(player) == 0 then local table = split(clothing,",") addPedClothes (player,table[1] , table[2],tonumber(table[3])) end And don't forget this function: isGuestAccount
  2. Works wonderful against lagg. (especially disable haze heat) setBlurLevel(0) setHeatHaze (0) Your problem > Edit the shader.....
  3. this is removing it: testtable[name.. index]=nil table.remove Removes the variable from the array position, so the array stays clean from empty places. myTestTable={"a","b","c","d"} --is the same as: myTestTable={ [1]="a", [2]="b", [3]="c", [4]="d"} myTestTable={ [1]="a",-- [1] array location 1 [2]="b", [3]="c", [4]="d"}-- [4] array location 4 table.remove(myTestTable,2) --result: myTestTable={ [1]="a", [2]="c", [3]="d"} Since you don't have a clear array based on numbers, you can't use table.remove. Or you have to do it like this: function RemoveFromTable( name ) if testtable[name] then testtable[name] = nil end end function RemoveVariableFromTable( name,variable ) local table = testtable[name] if table then for i=1,#table do if table[i]== variable then table.remove(table,i) break end end end end function ADDtoTable( name,variable ) local table = testtable[name] if table then table[#table+1]=variable else testtable[name] = { variable } end end
  4. I don't know why sometimes the ped collisions are still active when they are already dead. But you can try this to prevent the wall... client https://wiki.multitheftauto.com/wiki/On ... eCollision server setElementVelocity and find a paid scripter.......
  5. https://wiki.multitheftauto.com/wiki/CreateProjectile Read the page careful, especially the sync part.
  6. wrong section, that is scripting related.
  7. You mean removing it? local index = 1 while true do if testtable[name.. index] then testtable[name.. index]=nil else break end end Same way. But this is better and faster. function RemoveFromTable( name ) if testtable[name] then testtable[name] = nil end end function RemoveVariableFromTable( name,variable ) local table = testtable[name] if table then for i=1,#table do if table[i]== variable then table.remove(table,i) break end end end end function ADDtoTable( name,variable ) local table = testtable[name] if table then table[#table+1]=variable else testtable[name] = { variable } end end
  8. local index = 1 while true do if not testtable[name.. index] then testtable[name.. index]=variable break end end
  9. by toggle the control state to false after firing.
  10. This one can: 0x000400 - fires every frame within loop (ie paint spray) Except it also brings some problems with it. Good luck!
  11. Well you need to know those arguments, before you can show anything. > title, logo, content That will be send from serverside. (this is clientside)
  12. indeed Tables are the most secure way to save your data. Also if you stop sharing elementdata, (by put the last argument on false) cheaters won't know the elementdata key's.
  13. Because only the server knows what the parameters are: title, logo,content. Btw did you asked the owner if you are allow to edit his script? @Anubhav First read the code careful and then your conclusion. > guiCreateStaticImage, this is a gui image.
  14. 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)
  15. bindKey("x","down",function () for _,v in pairs ( items ) do local object = createObject ( 929, v[1], v[2], v[3] ) end end)
  16. 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
  17. 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 )
  18. 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 )
  19. 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....."
  20. 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
  21. True, but it would be a waste of your memory since you only use it for counting.
  22. 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 )
×
×
  • Create New...