bartje01 Posted June 15, 2012 Share Posted June 15, 2012 Hey guys. I want that if the player his level = 2, the triggerevent activates. I have this: if getElementData(source, tostring(sqldata[1]["level"])) == 2 then triggerClientEvent ( source,"l2", source ) Well, I know that this is terribly wrong, but I'm not sure how to fix it. Does anyone have an idea? This is the executetable (Not sure if needed) executeSQLCreateTable("levels", "accountname STRING, level INT") Link to comment
Moderators IIYAMA Posted June 15, 2012 Moderators Share Posted June 15, 2012 You can't use that as handler, You have to trigger from the script, that set this element data or you can use a timer. Link to comment
bartje01 Posted June 15, 2012 Author Share Posted June 15, 2012 Ye... well. I don't understand :l Link to comment
Anderl Posted June 15, 2012 Share Posted June 15, 2012 You can't use that as handler,You have to trigger from the script, that set this element data or you can use a timer. What the hell are you talking? Hey guys. I want that if the player his level = 2, the triggerevent activates.I have this: if getElementData(source, tostring(sqldata[1]["level"])) == 2 then triggerClientEvent ( source,"l2", source ) Well, I know that this is terribly wrong, but I'm not sure how to fix it. Does anyone have an idea? This is the executetable (Not sure if needed) executeSQLCreateTable("levels", "accountname STRING, level INT") local sql = executeSQLQuery ( 'SELECT `level` FROM `levels` WHERE accountname = "myAccount"' ); if ( tonumber ( sql[1]['level'] ) == 2 ) then triggerClientEvent ( source, 'l2', source ); -- is source element defined? end 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