Jump to content

Help touching up


Blueman

Recommended Posts

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

Link to comment

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