-
Posts
1,461 -
Joined
-
Last visited
-
Days Won
34
Everything posted by DiSaMe
-
That limit isn't just for objects, but for total number of elements.
-
Abort of long executions prevents MTA from freezing in case of infinite loop. However, I must agree it often makes things worse if big amount of data needs to be processed. I think it'd be better if MTA had a feature to turn it off.
-
Map limit seems to be a bug rather than a limitation. Inability to create water outside map is a GTA limitation (I think), but I'd still like to see MTA overcome it.
-
You need to check if the player who hit the colshape is local player.
-
getCameraMatrix + setElementRotation + some little trigonometry.
-
You can decide yourself: http://bugs.mtasa.com/roadmap_page.php
-
It's not necessary to create the object on every client. It can be server-side object and player ID could be stored as element data. Only setting element position and rotation needs to be client-side.
-
Or you can trigger another client event from server which would contain the 'return' value. But element data is still easier and more efficient way.
-
function addBinaryValueToString(s,value,size) if value == false then value = 0 end if value == true then value = 1 end if type(value) == "number" then value = value%(256^size) for bytenum = 0,size-1 do s = s..string.char(math.floor(value%256)) value = value/256 end elseif type(value) == "string" then value = value..string.rep("\0",size-string.len(value)) s = s..value end return s end s is a string you want to join the new bytes to, value is the value you want to join, it can be a boolean, integer or string, size is number of bytes you want to join. Function returns s string with new bytes joined. First I made a function which writes the value directly to the file, but it turned out to be faster to write more bytes in less times than less bytes in more times. Using this function on long strings is slow too, so it's best to write the data to the file when the string is long enough.
-
That would be the same, because code would be executed on the same frame. Timers are necessary to do things like that, but it would need more scripting.
-
You need to write all sections with their headers before writing texture native struct section. This is TXD file structure. Try looking at TXD files with RW analyzer. Without it, I would hardly have understood RW format.
-
It's not about script made improperly. It's about lots of data having to be processed. It's done when resource starts, so it wouldn't cause problems such as freezing during the game. Anyway, that's just a temporary way to see how things work, and I'm going to make a better script without long loops.
-
SA's PS2 version of 2 player free-roam/Co-op gaming modes
DiSaMe replied to galacticninja's question in Client
ZDay gamemode by Slothman has zombie bots, but they have no weapons. I don't know any other gamemodes which have AI enemies. -
A script in my gamemode uses a loop which isn't infinite, but execution takes too long, so it's aborted before it's finished. Is it possible to increase maximum loop length?
-
When you draw image client-side, you create green squares. Their coordinates are transferred to the server with triggerServerEvent when you close drawing window. Server uses them to store data in a matrix, 128x128 table. If a pixel is drawn over, its value in the raster is true, otherwise it's nil. Then it creates TXD file, and writes the beginning until it reaches position where raster data in the file starts. It cycles through the table, writes image data and final RW sections, then closes the file. Firstly I made it create BMP files because that format is very simple.
-
There's no function findPlayerByName, unless you create one. If you need to get player with a specified nickname, use getPlayerFromName. And it's better to store function result in a variable if you need to use it a few times. I'll try to correct your code addCommandHandler("use", function(player,command,Fun,FunPlayerName) local playerToFun = getPlayerFromName(FunPlayerName) if playerToFun then outputChatBox (FunPlayerName.." #FF0000is use "..Fun.." with "..getPlayerName(player),getRootElement(),51,255,0,true) end end )
-
they are named same.. look at my earlyer post They aren't named same. They only use variables which are named the same. Second texture is loaded after the first has already been imported, so it's not the problem.
-
Make sure that the path to the files is correct.
-
So you can set destination coordinates serverside and use them clientside. Then every client will control the ped separately, but the results will be the same. Peds work in this way in the video I posted.
-
Hmmm.... Maybe not... Not yet I think I will work a bit more on it and then release it.
-
And I want to have a dam and underground tunnels and subways outside the map.
-
function showPlayersList() local all_players = getElementsByType("player") for num,this_player in ipairs(all_players) do local plname = getPlayerName(this_player) dxDrawText(plname,100,100+num*16) --num increases with each cycle, so every name is drawn under previous name end end addEventHandler("onClientRender",getRootElement(),showPlayersList) Maybe this will help you to start.
-
Don't use math.random to get skin directly. It may return ID which doesn't have a skin defined in. It's better to make a table of available skins and use it.
-
The last line has a bracket which shouldn't be there.