HuskLV Posted April 3, 2016 Share Posted April 3, 2016 Hello. I make bondage system, but script check bondage level and error 3 line. Script there. function atkaribasCheck() local atkariba = mysql:query_free( "SELECT atkaribaLVL FROM characters WHERE id = " .. getElementData( source, "dbid" ) ) if (atkariba>10) then outputChatBox("Jūs esiet atkarīgs no narkotikām, lai ārstētos Jums jālieto vēl vai jādodas uz slimnīcu!", source) else outputDebugString("INFO: Atkarības sistēma work!") end end Link to comment
Fist Posted April 3, 2016 Share Posted April 3, 2016 problēma ir tāda ka 'atkarība' ir boolean vērtība (true vai false), varbūt informāciju nepareizu esi aizsūtijis vai arī tev kaut kas ar to sistēmu nav kārtībā. Link to comment
HuskLV Posted April 3, 2016 Author Share Posted April 3, 2016 function atkaribasCheck() local atkariba = mysql:query_free("SELECT `atkaribaLVL` FROM `characters` WHERE `id`='".. getElementData( thePlayer, "dbid" ).."'") if (tonumber(atkariba>10)) then outputChatBox("Jūs esiet atkarīgs no narkotikām, lai ārstētos Jums jālieto vēl vai jādodas uz slimnīcu!", thePlayer) else outputDebugString("INFO: Atkarības sistēma work!") end end Viss ir pareizi savadīts. Nomainīju if (tonumber(atkariba>10)) then un pārveidoju nedaudz to atkariba tāpat ir tas pats errors. Link to comment
Anubhav Posted April 3, 2016 Share Posted April 3, 2016 function atkaribasCheck() local atkariba = mysql:query_free("SELECT `atkaribaLVL` FROM `characters` WHERE `id`='".. getElementData( thePlayer, "dbid" ).."'") if (tonumber(atkariba) > 10) then outputChatBox("Jūs esiet atkarīgs no narkotikām, lai ārstētos Jums jālieto vēl vai jādodas uz slimnīcu!", thePlayer) else outputDebugString("INFO: Atkarības sistēma work!") end end Link to comment
HuskLV Posted April 3, 2016 Author Share Posted April 3, 2016 function atkaribasCheck() local atkariba = mysql:query_free("SELECT `atkaribaLVL` FROM `characters` WHERE `id`='".. getElementData( thePlayer, "dbid" ).."'") if (tonumber(atkariba) > 10) then outputChatBox("Jūs esiet atkarīgs no narkotikām, lai ārstētos Jums jālieto vēl vai jādodas uz slimnīcu!", thePlayer) else outputDebugString("INFO: Atkarības sistēma work!") end end Not work. Error in - local atkariba = mysql:query_free("SELECT `atkaribaLVL` FROM `characters` WHERE `id`='".. getElementData( thePlayer, "dbid" ).."'") Link to comment
Fist Posted April 3, 2016 Share Posted April 3, 2016 nejau skripts ir nepareizs bet gan pats variable 'ATKARIBA' viņā ietur BOOLEANS kas ir TRUE vai FALSE bet tu BOOLEAN samēri ar CIPARU, tāpēc tāds errors ir. Link to comment
Fist Posted April 3, 2016 Share Posted April 3, 2016 tak varbūt tas int() ir vainīgs vajag tieši ciparu, paņem vnk outPutChatBox(atkariba) izdari un čatā redzēsi ja būs false vai int(11) tad tāpēc tā vaina ir. Link to comment
Anubhav Posted April 3, 2016 Share Posted April 3, 2016 thePlayer is not defined as far as I see. That is why getElementData returns false causing that error. Link to comment
Tete omar Posted April 4, 2016 Share Posted April 4, 2016 Please only speak English in English sections. You might also want to ask to have your language section added to the Other languages sub-forum by making a request topic here. Read: https://forum.multitheftauto.com/viewtopic.php?f=131&t=30756 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