-
Posts
2,973 -
Joined
-
Last visited
-
Days Won
3
Everything posted by 50p
-
My fail, fixed in code above. He just copied and stuck with that error. @50p: everything comes of the script kevin11 posted, thePlayer as well. I just tried to explain the errors he had and show a way to avoid. Using 3 variables is only for visibility purposes. Fair enough but I didn't ask you about thePlayer. If you're fixing code, fix it so it works or don't fix it and give tips so that author can try to fix it himself. When you're giving sample code, don't copy & paste original code but show the sample code only. That way he learns and tries to implement the code in his script. I know many people don't like my way of teaching but after all they're thankful and actually learn something, not just getting the code, disappearing from the forum and coming back for more code when in need. Anyway, let's just wait for topic's author to reply.
-
I do not recommend spawning maps that far away. There are many issues with maps that are spawned outside SA map (mainly camera clipping) so more than 3000 is not recommended. I will add one more text box with Z where you can change Z but not X and Y (maybe in the far future).
-
I've been having problems with toJSON and fromJSON (even with JSON data in C#, that's why my SDK doesn't have any classes to help with returned data from MTA server). Just save every channel separately or: Where is thePlayer variable coming from? Antibrid, how can you unpack a function (tip: fromJSON, line 23)? Also, why do you create 3 separate variables which are used once (go straight to table)? Why not simply: local nameColor = { getPlayerNametagColor( source ) };
-
This is so obvious that I'm sure you wouldn't have to make a new thread to ask this question. Do you still wonder how to save it? I'll be willing to write these few lines for you if you're still having problems.
-
Your line 2 is invalid. You better check addEventHandler parameters. No wonder why you get error.
-
Yes, you. Do you think colour is just 1 value? It is for drawing functions (client-side) but not for name. Why don't you try to think for a second or two? Look at setPlayerNametagColor function parameters at wiki and ask yourself: "What should I save that I can load/use later in setPlayerNametagColor?" I'm sure you can answer this question within time of 1 second after seeing setPlayerNametagColor parameters.
-
Then read about moveObject function more... I guess you don't want to rotate it in one direction.
-
As I said, check the coords and rotations. The object is spawned where you tell it to. The problem is you messed up the rotation values. On createObject line, change the Y rotation value from 1.5 to 90 and you will see the difference. And if you have rotation in moveObject function, it will rotate your object every time you move it and eventually it will spin around. If you rotate it by 1.5 every 10 seconds, it will rotate 360 within 2 minutes.
-
I gave you example...
-
Where do you expect models to spawn? I just checked, and the objects are where they are supposed to be (somewhere out of Los Santos) at the level of the water. So I don't know what your problem is? I also started the map with race gamemode and I spawn at the quarry (Las Venturas). Make sure the coords are correct.
-
I get this error every time I call ANY exported function from ANY resource. To make sure the resource is running, add to your meta.xml. I do not guarantee any success, as I said I've always had problems with calling exported functions and none of MTA devs could help me. If you figure out what might be the problem, let us know. EDIT: Just noticed, race gamemode can't call mapmanager's functions neither.
-
What do you mean "nothing seems to help"? Don't you see any message when trying to start the resource? Give us a link to your entire resource or remake the script if you want. Everything looks fine to me.. I'm just worried that server doesn't tell you that something is wrong with the resource. Check the spelling of your script and the one in meta.xml. Also, check map file name. Try to name the file without spaces.
-
If you checked /debugscript 3 and you didn't see any error/warning message then it must be something wrong with the script. Since your script is small, try to debug it and check if the onResourceStart event is triggered. If it's not called try "debugscript 3" command again because your script looks fine.
-
Have you noticed there is a new release? Try the new one (v0.3) and see whether it works for you now.
-
You can easily sort values within SQL queries. That's only if you use SQL tables to store points. You can also sort numbers in tables. points = { 4, 6, 7, 8, 5, 9 } table.sort( points ); for k, v in ipairs( points ) do print( k .. ". " .. v ); end --[[ 1. 4 2. 6 3. 7 4. 8 5. 5 6. 9 ]] If you want the highest to be on top and the lowest on bottom then you have to make a function which will compare 2 numbers and return the higher one. And use this function in table.sort function. Like so: table.sort( points, function( a, b ) return a > b end ); --[[ output: 1. 9 2. 8 3. 7 4. 6 5. 5 6. 4 ]] If you want to know more about table.sort function or sorting in Lua go here: http://www.lua.org/manual/5.1/manual.ht ... table.sort http://www.lua.org/pil/19.3.html
-
Your Admin acl doesn't have access to start/stop/restartResource functions even thought it has access to start/stop/restart commands. Just add these: <right name="function.startResource" access="true" /> <right name="function.stopResource" access="true" /> <right name="function.restartResource" access="true" />
-
Well, server-side event passes false if the player died himself. I guess it's the same in this client-side event.
-
[miLKy_wAy], I've been testing and fixing the bugs that may cause models not to be replaced. I forgot that for loops in MAXScript start with 0 whereas Lua's tables start with 1. So if you try to replace 1 model, it will not be replaced because the for loops in Lua script tries to replace model with ID 4001 but model ID in map file starts with 4000. You can fix it by changing 1 thing in Lua script. Change the followings: engineReplaceModel( temp, i + 4000 ); engineReplaceCOL( temp, i + 4000 ); -- to this: engineReplaceModel( temp, (i-1) + 4000 ); engineReplaceCOL( temp, (i-1) + 4000 ); Also, if you want your models to be visible from long distance (max 300 units), add this line below engineReplaceCOL: engineSetModelLODDistance( (i-1) + 4000, 300 ); EDIT: I just found out that sometimes when you want to restart the custom map resource and you made some changes by 3DS Max (like re-exported the map), it may fail to restart and output an error: "Couldn't parse meta.xml for 'yourresourcename'". This is caused by 3DS Max not closing the file properly and MTA can't open it. To fix this, you have to close 3DS Max and "refresh" server (it's a refresh command that you type in console or in-game) to try and parse meta.xml again. I can't figure out why it happens but I'm sure it may be annoying to close 3DS Max and open it to re-export.
-
The Max script generates code that replaces models starting with ID 4000. That's just a random number that came to my mind at scripting time. Also, I was aiming to "race" mappers, so it doesn't really matter what model is replaced since race maps are fully custom. I may add a text box which will let user insert their own ID. I also thought of a feature that will let users set their spawn points straight in 3DS Max. [miLKy_wAy], I managed to get MTA to work and I'll test some maps including yours. Just post your latest resource here and I'll try to figure out what is wrong.
-
Well, when you delete vehicle, you remove the vehicle from game and memory but the pointer to the vehicle (which doesn't exist any more) is still in your car table. So, you have to remove the vehicle from the table as well (nil it) or when you save your map and you loop through the table, just add an if statement with isElement, which will check if the "vehicle variable" is vehicle. Something like: ... if isElement( v.car ) then -- if vehicle exists, isElement will return true and code will follow here, where you save your vehicle end ...
-
its replaced model thing, not the scripting or anything related to mta how to script to add replace models and paintjobs?? in other words In other words, you can not change/add paintjobs even for custom vehicles.
-
If I were you, I would create a global variable which would hold vehicle element (whichever you select) and then use this variable anywhere where you edit the vehicle (position, colour, etc.) Something like this: local selectedVeh; -- select command: selectedVeh = car[ tonumber( selID ) ].car;
