• Content Count

  • Joined

  • Last visited

Community Reputation

2 Neutral

About grazia

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Damn, it worked! many thanks! i've learned a lot. but i just want to ask, what is '#' for? and this code you write it just like giving value to random players isn't? -- test code if #players > 0 then setElementData(players[math.random(#players)], "something", "something") end --
  2. so for example there is element "playerid" from all players online, i can get all value from getAllElementData? local allPlayerID = getAllElementData("playerid") ??
  3. Hello, sorry this is my first thread for asking something about how to get specific elements data for all players i've tried some of code like getElementsByType, getElementData, but still i dont know how, and im new in Lua programming, but experience in code like C, and website programming such as php, jvscript. addCommandHandler( "check", function(player) local checkplayerid = getElementsByType("playerid",below) local first = 1 local found = false local i =0 while(found == false) do local yes = isValueInTable(checkplayerid,first,i) if yes then outputChatBox(first .. 'and' .. i .. 'is same',player,255,100,100) else outputChatBox(first .. 'is found!',player,255,100,100) setElementData(player,'playerid',first) found = true end first = first + 1 i = i + 1 end end) function isValueInTable(theTable,value,columnID) assert(theTable, "Bad argument 1 @ isValueInTable (table expected, got " .. type(theTable) .. ")") local checkIsTable = type(theTable) assert(checkIsTable == "table", "Invalid value type @ isValueInTable (table expected, got " .. checkIsTable .. ")") assert(value, "Bad argument 2 @ isValueInTable (value expected, got " .. type(value) .. ")") assert(columnID, "Bad argument 3 @ isValueInTable (number expected, got " .. type(columnID) .. ")") local checkIsID = type(columnID) assert(checkIsID == "number", "Invalid value type @ isValueInTable (number expected, got " ..checkIsID .. ")") for i,v in ipairs (theTable) do if v[columnID] == value then return true,i end end return false end im using isValueInTable from wiki mta for check the value in table im just a new scripter in Lua, im sorry for ugly code. sorry bad english
  4. im sorry i want to ask, I don't know, what's the difference between this and relative?