Jump to content

Help needed!! FAST!


megaman54

Recommended Posts

Posted

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! :?:oops:

Posted

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.

Posted (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 by Guest
Posted
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.

Posted

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
)

Posted
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..

Posted

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 :wink:

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. :wink:

Posted

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 :D

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 :D

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...