05-18-2017, 11:06 PM
(This post was last modified: 05-18-2017, 11:10 PM by Seadragon91.)
The code does this:
Add the code in a plugin and register the command:
cPluginManager:BindCommand("/testmap", "testmap", CommandTestMap, "testmap")
- Add map to player inventory with damage value 1, if not existent
- Call callback on the map
- For loop with x,y = 1- 100, the size is by default 128 x 128
- Set the pixel to cMap.E_BASE_COLOR_TRANSPARENT
Add the code in a plugin and register the command:
cPluginManager:BindCommand("/testmap", "testmap", CommandTestMap, "testmap")
function CommandTestMap(a_Split, a_Player) if not(a_Player:GetInventory():HasItems(cItem(E_ITEM_MAP,1, 1))) then -- Add map a_Player:GetInventory():AddItem(cItem(E_ITEM_MAP, 1, 1)) end a_Player:GetWorld():GetMapManager():DoWithMap(1, -- damage value = item id of map function(a_Map) a_Player:SendMessage("Callback called") for x = 1, 100 do for y = 1, 100 do a_Map:SetPixel(x, y, cMap.E_BASE_COLOR_TRANSPARENT) end end end) a_Player:SendMessage("Done!") return true end