lexagav[RUS] Posted April 9, 2009 Posted April 9, 2009 I wanted to do a easy script. This script is when player enter marker gate open ad when player exit marker close gate. I try to do it many times but i cant!!!There is my script: function loadObjects() Gate = createObject( 986, 321.32440185547, -1188.1290283203, 77.13875579834, 0, 0, 38.368804931641 ) marker = createMarker( 320.8876953125, -1187.8742675781, 75.522003173828, "cylinder", 6, 0, 255, 1, 1 ) end addEventHandler("onResourceStart", getRootElement(), loadObjects) function playerEnterMarker ( marker ) if ( Playeris ( lexagav[RUS] ) ) or ( Playeris ( skydj[RUS] ) ) then addEvent = moveObjects(Gate, 5000, 321.32440185547 , -1188.1290283203, 77.13875579834) end end addEventHandler("onResourceStart", getRootElement(), moveobjects) But it DOESNT WORK!!!!!!!!!!!!!!!!!!!Help pls!!!!!!!!
lexagav[RUS] Posted April 9, 2009 Author Posted April 9, 2009 Script is not finished I just want to open gate but i cant do it!!!!!And i want to do gates for all players not only for this who is in my script!!!HElp!!!
robhol Posted April 9, 2009 Posted April 9, 2009 You can't just write random bullshit in your code and expect it to work. Go to the wiki, read the basics. I could piss more coherent code in snow, for god's sake. Also, spamming question and exclamation marks and bumping your topic after 7 minutes isn't going to get you any more help - just make you look retarded and probably make people not want to help you. Do NOT PM ME for help unless invited. - New MTA Script Editor Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.
Gamesnert Posted April 9, 2009 Posted April 9, 2009 Besides that, wrong section. (correct one) Projects: Slothbot | Maximap
lexagav[RUS] Posted April 10, 2009 Author Posted April 10, 2009 Thanks but i already do the gates!!! I read basic and all was easy now!!!!!!!!!!!!!
lexagav[RUS] Posted April 10, 2009 Author Posted April 10, 2009 And i have another question!!I read all wiki but i cant find information about spawnpoint in freeroam!!Help pls!!!!
Gamesnert Posted April 10, 2009 Posted April 10, 2009 Could you please ask in a normal way? I doubt anyone will help you like this, especially since robhol already mentioned this. Oh and rephrase your question, I don't even understand WHAT you need... Projects: Slothbot | Maximap
lexagav[RUS] Posted April 11, 2009 Author Posted April 11, 2009 I want to spawn players on the coordinates 298.2 -1156.8 80.9 in freeroam gamemode but i cant do this!!!!!
lexagav[RUS] Posted April 11, 2009 Author Posted April 11, 2009 I want to spawn players on the coordinates 298.2 -1156.8 80.9 when they join. I do this in dm but in freeroam gamemode i cant!!!!!
Gamesnert Posted April 11, 2009 Posted April 11, 2009 1. Do not spam "!!!!" all the time. 2. Do not double post, ever wondered why there's an "Edit" button? I guess not. 3. What freeroam... Freeroam GUI? The beauty of that resource is that you can spawn wherever you like, why should you make a spawnpoint... Projects: Slothbot | Maximap
lexagav[RUS] Posted April 12, 2009 Author Posted April 12, 2009 No i dont want to close teleport function.I just want to spawn players when they join like on server Lainelaitos
Gamesnert Posted April 12, 2009 Posted April 12, 2009 Now that's more like it. You can make a new script file inside freeroam resource, with onPlayerJoin and spawnPlayer. That should make the player spawn in the beginning, without having to disable the teleporting. Projects: Slothbot | Maximap
Dark Dragon Posted April 12, 2009 Posted April 12, 2009 i guess onClientResourceStart would be a better choice, but the gui window would still pop up, wouldn't it? Loads of fun for free! Also a lot of fun for free!
Gamesnert Posted April 12, 2009 Posted April 12, 2009 Afaik it doesn't pop-up on join. And eh, spawnPlayer doesn't work client-side... Projects: Slothbot | Maximap
lexagav[RUS] Posted April 13, 2009 Author Posted April 13, 2009 I do this script with your events but he doest work! Veiv my script and configure it if you can! function spawn ( source, player ) local joinedPlayerName = getClientName ( source ) spawnPlayer( .. joinedPlayerName .., 298.2, -1156.8, 80.9, 90, 200 ) setCameraTarget( .. joinedPlayerName .. ) fadecamera( .. joinedPlayerName .., true ) end addEventHandler("OnPlayerJoin", getRootElement(), spawn) meta
Gamesnert Posted April 13, 2009 Posted April 13, 2009 Why the '..' everywhere lol... Try removing those? Besides, it's onPlayerJoin, not OnPlayerJoin. Projects: Slothbot | Maximap
heavy air Posted April 18, 2009 Posted April 18, 2009 function spawnThePlayer ( player ) local b = spawnPlayer ( player, -711+math.random(1,5), 957+math.random(5,9), 12.4, 90, math.random(9,288) ) if not b then spawnThePlayer ( player ) return end fadeCamera(player,true) end i think this might be what u need its from the BROPH resource just change coordinates in local b to where u want player to spawn you will need to call the function with onPlayerJoin the random numbers are so people dont spawn in a big tower i think MTA the gift that keeps on giving ALL! HAIL! THE MTA TEAM!!!
Brophy Posted April 18, 2009 Posted April 18, 2009 the randoms numbers are so that people dont spawn inside each other
Gamesnert Posted May 24, 2009 Posted May 24, 2009 Why the '..' everywhere lol... Try removing those?Besides, it's onPlayerJoin, not OnPlayerJoin. Projects: Slothbot | Maximap
lexagav[RUS] Posted May 24, 2009 Author Posted May 24, 2009 function spawnThePlayer ( player ) local b = spawnPlayer ( player, -711+math.random(1,5), 957+math.random(5,9), 12.4, 90, math.random(9,288) ) if not b then spawnThePlayer ( player ) return end fadeCamera(player,true) end i think this might be what u need its from the BROPH resource just change coordinates in local b to where u want player to spawn you will need to call the function with onPlayerJoin the random numbers are so people dont spawn in a big tower i think This doesnt work((( May be i do something wrong but i dont know what
Recommended Posts