Sande Posted November 16, 2013 Share Posted November 16, 2013 I am trying to make ticket system for trains. But when i am in Ticket check team and do /hsl-tarkasta myname , it doens´t say anything. idk whats wrong. No erros. help me pls. TrainDriverTeam = createTeam ( "Train-driver", 0, 17, 255 ) WorkersTeam = createTeam ("Ticket-inspector", 0, 153, 255 ) function ostaLippu11 ( thePlayer ) if getPlayerMoney(thePlayer) < 5000 then outputChatBox("[HSL] Sinulla ei ole tarpeeksi rahaa ostaaksesi metrolippua.", thePlayer, 255, 0, 0) return end outputChatBox("[HSL] Ostit metrolipun.", thePlayer, 0,255,0) takePlayerMoney(thePlayer, 5000) local id = math.random(1,20) if (id) then outputChatBox ("[HSL] Sinun lippu-numero on : "..tostring(id)..".", thePlayer, 0,255,0) outputChatBox("[HSL] Pelaaja "..getPlayerName(thePlayer).." osti lipun.", getPlayerFromName("Sisuviina"), 0,255,0) outputChatBox ("[HSL] Pelaajan "..getPlayerName(thePlayer).." Lippunumero on: "..tostring(id)..".", getPlayerFromName("Sisuviina"), 0,255,0) givePlayerMoney (getPlayerFromName("Sisuviina"), 5000) setElementData(thePlayer, "metroLippu", true) end end addCommandHandler("hsl-lippu", ostaLippu11 ) function tarkastaLippu(thePlayer, command, target) local team = getPlayerTeam(thePlayer) if getTeamName (team) == "Ticket-inspector" then local target = getPlayerFromName ( target ) if ( target ) then if getElementData(target, "metroLippu" ) == true then outputChatBox("[HSL] Pelaajalla "..getPlayerFromName(target).." on voimassa oleva matkustusoikeus.", thePlayer, 0,255,0) else outputChatBox("[HSL] Pelaajalla "..getPlayerFromName(target).." ei ole voimassa olevaa matkustusoikeutta.", thePlayer, 255,0,0) end end end end addCommandHandler("hsl-tarkasta", tarkastaLippu ) Link to comment
glowdemon1 Posted November 16, 2013 Share Posted November 16, 2013 Try replacing line 36 with addCommandHandler("hsl-tarkasta", tarkastaLippu,target ) 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