megaman54 Posted October 29, 2009 Share Posted October 29, 2009 Hi all! I'm new in this LUA thing and i created gamemode (it is the same as in the tutorial). It looks like this: function joinHandler() local x = 2497.2021 local y = -1666.7891 local z = 13.3850 spawnPlayer(source, x, y, z) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Welcome to this server!", source) outputChatBox("Press F9 for help!", source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) as you can see it is very simple and now i want to add there a thing that spawns the player again when he/she gets killed at the same spot when joined. Always when someone dies he/she must reconnect. Help me in this PLZ! Link to comment
MOH Posted October 29, 2009 Share Posted October 29, 2009 WHile you are doing that, I suggest you add a camera fade. Those are my favorite. Here is a rough otuline plr = getLocalPlayer() fadeCamera(false, 5) setCameraMatrix(1509.7109375, -1675.236328125, 27.322862625122, 1553.4326171875, -1675.4794921875, 23.332290649414) fadeCamera(true, 5) showCursor(true) Even though this one fades into the police station, just change coordinates. Link to comment
DakiLLa Posted October 29, 2009 Share Posted October 29, 2009 (edited) ehm, i thought he was needed the next thing: addEventHandler( "onPlayerWasted", getRootElement( ), function( ) setTimer( spawnPlayer, 2000, 1, source, 2497.2021, -1666.7891, 13.3850 ) end ) right? Edited October 30, 2009 by Guest Link to comment
MOH Posted October 29, 2009 Share Posted October 29, 2009 Who will playon your server when you have to reconnect if dead. Your a lost cause. Link to comment
megaman54 Posted October 30, 2009 Author Share Posted October 30, 2009 Thank you Dakilla! I will test that and tell if it is working! Link to comment
50p Posted October 30, 2009 Share Posted October 30, 2009 Thank you Dakilla! I will test that and tell if it is working! He added too many ) so expect it to fail. Remove 1 ) (at the line with setTimer) and you will be fine. Link to comment
DakiLLa Posted October 30, 2009 Share Posted October 30, 2009 ah, i just copied this from wiki..well, anyway, i fixed the example on the wiki Link to comment
megaman54 Posted October 30, 2009 Author Share Posted October 30, 2009 Thanks alot! But now i need add that it saves the player skin after dead. So need help with that Link to comment
DakiLLa Posted October 30, 2009 Share Posted October 30, 2009 well, nothing hard: you just need to get player skin and then apply it when he spawns addEventHandler( "onPlayerWasted", getRootElement( ), function( ) local skin = getElementModel( source ) setTimer( spawnPlayer, 2000, 1, source, 2497.2021, -1666.7891, 13.3850, 0, skin ) end ) Link to comment
megaman54 Posted October 31, 2009 Author Share Posted October 31, 2009 (edited) Again thanks alot! I want to add a thing that stores player weapons. Edited November 5, 2009 by Guest Link to comment
Dark Dragon Posted November 5, 2009 Share Posted November 5, 2009 trigger a client event, then use getPlayerWeapon in a for loop for i=0,8,1 do [...] for all weapon slots. i'd probably save them in a table. Link to comment
DakiLLa Posted November 5, 2009 Share Posted November 5, 2009 trigger a client event, then use getPlayerWeapon in a for loop for i=0,8,1 do [...] for all weapon slots. i'd probably save them in a table. Hi all! I'm new in this LUA thing and i created gamemode (it is the same as in the tutorial).It looks like this: ... blah blah blah ... i think he dont know what is client events and 'table' in lua.. yet.. Link to comment
Dark Dragon Posted November 5, 2009 Share Posted November 5, 2009 so you're basically saying i'm supposed to give him everything so he will never learn anything Link to comment
DakiLLa Posted November 6, 2009 Share Posted November 6, 2009 uhm, i mean that he is just newbie and he knows only how to spawn player in certain coordinates, but those things like 'client side', 'tables' etc. would be very hard to understanding for him. Well, anyway, he just need to read more articles on the wiki lets stop this offtopic btw, megaman54, i guess, this topic starts to be like "I want to add something, please, write it for me"... Try to write that script what you want to get, then show it for us, we will tell you about your mistakes and will give you some advices ofcourse. Link to comment
megaman54 Posted November 6, 2009 Author Share Posted November 6, 2009 Yes i try to make my own but its very hard because the tutorials aren't so... well "big". hope somebody understands me Today started working on Player Menu GUI and i like to know how to script the functions toGUI that i made with the GUI editor. Thanks EDIT: I also like to know how to save the work made in GUI editor so i can write functions to it and script and so on Link to comment
Lordy Posted November 7, 2009 Share Posted November 7, 2009 I think the robhol's tutorial is sufficent enough for you.. And 'big' enough https://forum.multitheftauto.com/viewtop ... 91&t=25032 Link to comment
Dark Dragon Posted November 7, 2009 Share Posted November 7, 2009 if its not big enough try ctrl + mouse wheel up Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now