destunter Posted April 29, 2010 Share Posted April 29, 2010 <"script /> addEventHandler("onPlayerJoin", getRootElement(), function () local x = 1959.55 local y = -1714.46 local z = 10 local pname = GetPlayerName( source ) spawnPlayer(source, x, y, z) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Welcome to Gaalaxy Stunting", source) outputChatBox ( pname.. "++ Has joined Galaxy Stunting!" ) setElementData( source, "deaths", 0 ); setElementData( source, "kills", 0 ); end ) -- Events addEventHandler("onPlayerWasted",getRootElement(), function (totalAmmo, killer, killerWeapon, bodypart) local pname = getPlayerName( source ) local pname2 = getPlayerName( killer ) outputChatBox(pname2.. " has Killed " ..pname) setElementData( source, "deaths", getElementData( source, "deaths" ) + 1 ); setElementData( killer, "kills", getElementData( killer, "kills" ) + 1 ); end ) -- Commands addCommandHandler( "stats", function( plr ) outputChatBox( "Your current stats: " .. getElementData( plr, "kills" ) .. "/" .. getElementData( plr, "deaths" ), plr ); outputChatBox( "Kills: " .. getElementData( plr, "kills" ), plr ); outputChatBox( "Deaths: ".. getElementData( plr, "deaths" ), plr ); end ) addCommandHandler ( "killme", function ( plr ) local pname = GetPlayerName( plr ) SetPlayerHealth( plr, 0 ) outputChatBox( pname.. "Has Killed Himself") end ) ok this is my whole lua script. i am using the MTA Script Editor. so when i start the server and it loads the script but it doesn't because none of this is working and its loading vehicles and other stuff i never added D= can someone please help me Link to comment
dzek (varez) Posted April 29, 2010 Share Posted April 29, 2010 you see broken colors on your code? what did you do actually? you have to put your code in separate files, then add them to meta.xml you wanted to add it like in HTML or something.. read about meta.xml and basics of scripting on the https://wiki.multitheftauto.com/ Link to comment
50p Posted April 29, 2010 Share Posted April 29, 2010 I will not tell you the same thing multiple times but GetPlayerName does NOT exist, there is getPlayerName... Forget about SA-MP. ALL MTA's function names start with lower case letters. Link to comment
FUNExtreme Posted April 29, 2010 Share Posted April 29, 2010 I will not tell you the same thing multiple times but GetPlayerName does NOT exist, there is getPlayerName...Forget about SA-MP. ALL MTA's function names start with lower case letters. Yea, I come from samp to so I'm used to the pawn functions. I've had a couple of issues because of this lower case allready Link to comment
destunter Posted May 1, 2010 Author Share Posted May 1, 2010 ok i fixed the getPlayerName but i am still not seeing my server and idk how to get any of this working i start mta server then i join it but i see stuff i never added and the commands do not work i attached the meta.xml and script.lua to this post 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