iPanda Posted September 6, 2013 Share Posted September 6, 2013 My problem is - mod does not work. I want to be a player comes to the server, when you press 1, he chooses the side of evil, or if you press 2, then the side of good. Each side spawns at two different points. function spawnGood ( player ) spawnPlayer ( player, posX, posY, posZ - 9, 0, 111, 0, 0, nil ) giveWeapon ( player, 23, 100 ) giveWeapon ( player, 8, 1 ) giveWeapon ( player, 35, 1 ) end function wastedGood ( ) spawnPlayer ( source, posX, posY, posZ - 9, 0, 121, 0, 0, nil ) giveWeapon ( source, 23, 100 ) giveWeapon ( source, 8, 1 ) giveWeapon ( source, 35, 1 ) end function spawnDead ( player ) spawnPlayer ( player, posX, posY, posZ - 9, 0, 111, 0, 0, nil ) giveWeapon ( player, 23, 100 ) giveWeapon ( player, 8, 1 ) giveWeapon ( player, 35, 1 ) end function wastedDead ( ) spawnPlayer ( source, posX, posY, posZ - 9, 0, 121, 0, 0, nil ) giveWeapon ( source, 23, 100 ) giveWeapon ( source, 8, 1 ) giveWeapon ( source, 35, 1 ) end addEventHandler ( "onPlayerJoin", getRootElement (), function ( ) bindKey ( "1" "down", spawnGood ) bindKey ( "2" "down", spawnDead ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( "1" "down", spawnGood ) bindKey ( "2" "down", spawnDead ) end end ) addEventHandler ( "onPlayerWasted", getRootElement (), wastedGood ) addEventHandler ( "onPlayerWasted", getRootElement (), wastedDead ) Link to comment
ZL|LuCaS Posted September 6, 2013 Share Posted September 6, 2013 errors debugscript 3 ? Link to comment
iPanda Posted September 6, 2013 Author Share Posted September 6, 2013 errors debugscript 3 ? I can not use debug, so do not use the login panel and can not access the server Link to comment
Prat Posted September 6, 2013 Share Posted September 6, 2013 Now i hope it works. Good luck function spawnGood ( player ) spawnPlayer ( player, posX, posY, posZ - 9, 0, 111, 0, 0, nil ) giveWeapon ( player, 23, 100 ) giveWeapon ( player, 8, 1 ) giveWeapon ( player, 35, 1 ) end function wastedGood ( ) spawnPlayer ( source, posX, posY, posZ - 9, 0, 121, 0, 0, nil ) giveWeapon ( source, 23, 100 ) giveWeapon ( source, 8, 1 ) giveWeapon ( source, 35, 1 ) end function spawnDead ( player ) spawnPlayer ( player, posX, posY, posZ - 9, 0, 111, 0, 0, nil ) giveWeapon ( player, 23, 100 ) giveWeapon ( player, 8, 1 ) giveWeapon ( player, 35, 1 ) end function wastedDead ( ) spawnPlayer ( source, posX, posY, posZ - 9, 0, 121, 0, 0, nil ) giveWeapon ( source, 23, 100 ) giveWeapon ( source, 8, 1 ) giveWeapon ( source, 35, 1 ) end addEventHandler ( "onPlayerJoin", getRootElement (), function ( ) bindKey ( "1", "down", spawnGood ) bindKey ( "2", "down", spawnDead ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( "1", "down", spawnGood ) bindKey ( "2", "down", spawnDead ) end end ) addEventHandler ( "onPlayerWasted", getRootElement (), wastedGood ) addEventHandler ( "onPlayerWasted", getRootElement (), wastedDead ) Link to comment
iPanda Posted September 6, 2013 Author Share Posted September 6, 2013 Now i hope it works.Good luck function spawnGood ( player ) spawnPlayer ( player, posX, posY, posZ - 9, 0, 111, 0, 0, nil ) giveWeapon ( player, 23, 100 ) giveWeapon ( player, 8, 1 ) giveWeapon ( player, 35, 1 ) end function wastedGood ( ) spawnPlayer ( source, posX, posY, posZ - 9, 0, 121, 0, 0, nil ) giveWeapon ( source, 23, 100 ) giveWeapon ( source, 8, 1 ) giveWeapon ( source, 35, 1 ) end function spawnDead ( player ) spawnPlayer ( player, posX, posY, posZ - 9, 0, 111, 0, 0, nil ) giveWeapon ( player, 23, 100 ) giveWeapon ( player, 8, 1 ) giveWeapon ( player, 35, 1 ) end function wastedDead ( ) spawnPlayer ( source, posX, posY, posZ - 9, 0, 121, 0, 0, nil ) giveWeapon ( source, 23, 100 ) giveWeapon ( source, 8, 1 ) giveWeapon ( source, 35, 1 ) end addEventHandler ( "onPlayerJoin", getRootElement (), function ( ) bindKey ( "1", "down", spawnGood ) bindKey ( "2", "down", spawnDead ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( "1", "down", spawnGood ) bindKey ( "2", "down", spawnDead ) end end ) addEventHandler ( "onPlayerWasted", getRootElement (), wastedGood ) addEventHandler ( "onPlayerWasted", getRootElement (), wastedDead ) You have not changed anything. It still does not work Link to comment
Castillo Posted September 6, 2013 Share Posted September 6, 2013 You forgot to define the player element at bindKey. function spawnGood ( player ) spawnPlayer ( player, posX, posY, posZ - 9, 0, 111, 0, 0, nil ) giveWeapon ( player, 23, 100 ) giveWeapon ( player, 8, 1 ) giveWeapon ( player, 35, 1 ) end function wastedGood ( ) spawnPlayer ( source, posX, posY, posZ - 9, 0, 121, 0, 0, nil ) giveWeapon ( source, 23, 100 ) giveWeapon ( source, 8, 1 ) giveWeapon ( source, 35, 1 ) end function spawnDead ( player ) spawnPlayer ( player, posX, posY, posZ - 9, 0, 111, 0, 0, nil ) giveWeapon ( player, 23, 100 ) giveWeapon ( player, 8, 1 ) giveWeapon ( player, 35, 1 ) end function wastedDead ( ) spawnPlayer ( source, posX, posY, posZ - 9, 0, 121, 0, 0, nil ) giveWeapon ( source, 23, 100 ) giveWeapon ( source, 8, 1 ) giveWeapon ( source, 35, 1 ) end addEventHandler ( "onPlayerJoin", getRootElement (), function ( ) bindKey ( source, "1" "down", spawnGood ) bindKey ( source, "2" "down", spawnDead ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "1" "down", spawnGood ) bindKey ( player, "2" "down", spawnDead ) end end ) addEventHandler ( "onPlayerWasted", getRootElement (), wastedGood ) addEventHandler ( "onPlayerWasted", getRootElement (), wastedDead ) 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