Blueman Posted May 11, 2011 Share Posted May 11, 2011 I'm wanting some help touching up my script a bit to fix any possible errors I might have made. local x = 2026.935668953 local y = 1008.9664306641 local z = 14.663164138794 function spawn (prevA, curA, autoLogin) createTeam ( Owner, 255, 0, 0 ) createTeam ( Admin, 255, 0, 0 ) createTeam ( MegaDragon, 45, 150, 0 ) createTeam ( Regular, 0, 0, 150 ) spawnPlayer(source, x, y, z, spawnTeam) fadeCamera(source, true) setCameraTarget(source, source) giveWeapon(source, 22, 9000) outputChatBox("Please login to start playing", source) end addEventHandler("onPlayerLogin", getRootElement(), spawn) function playerDied(totalAmmo, killer, killerWeapon, bodypart) outputChatBox(getPlayerName(source).." died!") setTimer(spawnPlayer,1000,1,source, x, y, z) setTimer(fadeCamera,1000,1,source, true) setTimer(setCameraTarget,1000,1,source, source) giveWepon(source, 22, 9000) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) function playerDied(totalAmmo, killer, killerWeapon, bodypart) outputChatBox(getPlayerName(source).." died!") setTimer(spawnPlayer,1000,1,source, x, y, z) setTimer(fadeCamera,1000,1,source, true) setTimer(setCameraTarget,1000,1,source, source) end addEventHandler("onPlayerWasted",getRootElement(),playerDied) function OwnerAccount ( previous_account, current_account, auto-login ) if GetAccountName(current_account) == "Dragon" then setPlayerTeam" class="kw6">setPlayerTeam(soruce, Owner) setPlayerNametagText ( soruce, "Owner" ) else setPlayerTeam" class="kw6">setPlayerTeam(source, Regular) end end addEventHandler("onPlayerLogin",getRootElement(),OwnerAccount) So far I haven't found any errors but I'm pretty sure I could shrink this script. It's also been untested I'll be testing it while i'm waiting for a response. Link to comment
Klesh Posted May 11, 2011 Share Posted May 11, 2011 We need for what is this script,i mean for do what and we need to know too what not work to help you! Link to comment
NeXTreme Posted May 11, 2011 Share Posted May 11, 2011 First of all you have two functions with the same name (playerDied) Link to comment
Blueman Posted May 11, 2011 Author Share Posted May 11, 2011 First of all you have two functions with the same name (playerDied) o.e 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