Imposter Posted August 21, 2012 Share Posted August 21, 2012 What am i doing wrong? function onLogin() local thePlayer = getPlayerFromName(getPlayerName(source)) outputChatBox("Hello!", thePlayer) end addEventHandler("onPlayerLogin", getRootElement(), onLogin) I don't know why, but when i simply just write source, it doesnt work Link to comment
xPiwel Posted August 21, 2012 Share Posted August 21, 2012 What am i doing wrong? function onLogin() local thePlayer = getPlayerFromName(getPlayerName(source)) outputChatBox("Hello!", thePlayer) end addEventHandler("onPlayerLogin", getRootElement(), onLogin) When you start the resource, or when a player Login, do you have any error in the consol about this script ? Link to comment
sockz Posted August 21, 2012 Share Posted August 21, 2012 function onLogin(source) outputChatBox("Hello!", source) end addEventHandler("onPlayerLogin", getRootElement(), onLogin) Link to comment
Xeno Posted August 21, 2012 Share Posted August 21, 2012 You can't use onLogin as function name - sorry for the weird function name i have, i couldn't think of anything! function eatmyshit() local thePlayer = getPlayerFromName(getPlayerName(source)) outputChatBox("Hello!", thePlayer) end addEventHandler("onPlayerLogin", getRootElement(), eatmyshit) Link to comment
Imposter Posted August 21, 2012 Author Share Posted August 21, 2012 What am i doing wrong? function onLogin() local thePlayer = getPlayerFromName(getPlayerName(source)) outputChatBox("Hello!", thePlayer) end addEventHandler("onPlayerLogin", getRootElement(), onLogin) When you start the resource, or when a player Login, do you have any error in the consol about this script ? LOL seems to work now ... 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