Jump to content

Pio

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by Pio

  1. I guess there is special priority for sending data between client and server for events, so references for elements can be recieved before the elements data (sent with normal priority), and that's why they are nil for some time. In my script I don't need that data instantly (in event time), so I solved this by re-checking with timer (every 50ms) if it's element or not. If I'm wrong then please correct me.
  2. Hey xXMADEXx. That's not the problem - in 50ms tag It's ok. But I tried that and it breaks that function (if after that is timer and it doesn't execute). info[1] is still nil value when used too early. Client debugscript says (on both versions): attempt to index global 'info' (a nil value).
  3. Hey. I have a little problem - idk if I made a mistake there, maybe I need to know something , or it is a bug. Can some1 explain me how it works and what can I do to be sure it's all ok. So, I want to do a simple script executed on event "onGamemodeMapStart" (mapmanager triggers that), and send some map info but it looks like arguments are delayed. There's my example script: Server-side: addEventHandler("onGamemodeMapStart", root, function(mapResource) local mapRoot = getResourceRootElement(mapResource) local previews = getElementsByType("preview", mapRoot) outputChatBox("<server>") outputChatBox(getElementType(previews[1])) outputChatBox("</server>") triggerClientEvent("onServerSendInfo", resourceRoot, previews) end ) Client-side: addEvent("onServerSendInfo", true) addEventHandler("onServerSendInfo", resourceRoot, function(theInfo) outputChatBox("<now>") outputChatBox(getElementType(theInfo[1])) outputChatBox("</now>") setTimer( function() outputChatBox("<50ms>") outputChatBox(getElementType(theInfo[1])) outputChatBox("</50ms>") end , 50, 1) end ) Now, when I start a map, with any "preview" element, client gets them, but not at the event time (is delayed). There is client output: <now> </now> <server> preview </server> <50ms> preview </50ms> Tag "now" pops up first (before "server") -> for client it looks that triggerServerEvent executed before outputChatBox right? And the "now" tag has no value, after 50ms it has. (sometimes 50ms is not enought and this tag is also empty) Why is that?
  4. Hi all Today I uploaded 4 my maps to MTA:SA community resources. 3 DD's maps were done them very long time ago for some MTASA server, but had problems with upload then forgot about it so noone saw them. Stealth map was uploaded to the community resources, today I send updated version. I have not tested them with many players playing at the same time, they all should work good with up to 32 players. If you find a bug or something please report it to me. Thanks. Have fun playing. RACE (Destruction Derby) Maps: [DD] Taxi More Screens: Download dd-taxi [DD] Fallout Download dd-fallout [FUN] Packer More Screens: Download fun-packer STEALTH: [sTH] House More Screens: Download sth-house
  5. Pio

    About mapping...

    I think he wants to place Objects/Vehicles while other gamemode (not editor) is running. Doing the map while others are playing same server some gamemode.
  6. Are you searching for surface ID/collision type or something like that? This object is specific, repels vehicles on hit. Idk how it's done, but you can script it with onClientVehicleCollision getElementVelocity setElementVelocity getElementPosition getElementRotation
×
×
  • Create New...