UAEpro Posted February 2, 2012 Posted February 2, 2012 (edited) function rankk() local gotexp2 = getElementData(source,"exp212") if gotexp2 == 1 then outputChatBox(gotexp2) outputChatBox("*sorry",source,0,255,0,true) else outputChatBox("ok",source,0,255,0,true) setElementData(source,"exp212",1) end end addEventHandler("onPlayerWasted",getRootElement(),rankk) function new() setElementData(source,"exp212",0) alvw = getElementData(source,"exp212") outputChatBox(""..alvw) end addEvent("onMapStarting",true) addEventHandler("onMapStarting",getRootElement(),new) it always show "sorry" idk why another stupid problem Edited February 2, 2012 by Guest تيم سبيك بروجيمر ts3server://ts.pg.sa
Castillo Posted February 2, 2012 Posted February 2, 2012 function rankk() local gotexp2 = tonumber(getElementData(source,"exp212")) if (gotexp2 == 1) then outputChatBox(gotexp2) outputChatBox("*sorry",source,0,255,0,true) else outputChatBox("ok",source,0,255,0,true) setElementData(source,"exp212",1) end end addEventHandler("onPlayerWasted",getRootElement(),rankk) function new() setElementData(source,"exp212",0) alvw = getElementData(source,"exp212") outputChatBox(""..alvw) end addEvent("onMapStarting",true) addEventHandler("onMapStarting",getRootElement(),new) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
UAEpro Posted February 2, 2012 Author Posted February 2, 2012 same تيم سبيك بروجيمر ts3server://ts.pg.sa
Castillo Posted February 2, 2012 Posted February 2, 2012 Have you checked manually the data "exp212"? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
UAEpro Posted February 3, 2012 Author Posted February 3, 2012 1st getElementData(source,"exp212") must be nill it will say sorry in the chatbox then the value will be 1 so it will not say sorry again until another map start but it's not working تيم سبيك بروجيمر ts3server://ts.pg.sa
Kenix Posted February 3, 2012 Posted February 3, 2012 function rankk( ) local gotexp2 = tonumber( getElementData( source,"exp212" ) or 0 ) if gotexp2 == 1 then -- you can use if some then instand of if ( some ) then outputChatBox( tostring( gotexp2 ) ) -- gotexp2 is number value convert to string --outputChatBox( "*sorry",source,0,255,0,true ) -- why true ? Need use false see in arguments function outputChatBox( "*sorry",source,0,255,0 ) else --outputChatBox("ok",source,0,255,0,false ) -- same outputChatBox( "ok",source,0,255,0 ) setElementData( source,"exp212",1 ) end end addEventHandler( "onPlayerWasted",root,rankk ) function new( ) setElementData( source,"exp212",0 ) local alvw = getElementData( source,"exp212" ) -- variable alvw is number outputChatBox( tostring( alvw ) ) -- convert to string end addEvent( "onMapStarting",true) addEventHandler( "onMapStarting",root,new ) SolidShake14,Your code is wrong ... P.S Tabulate your code in next time. P.S See in /debugscript 3 P.S Code updated. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
UAEpro Posted February 3, 2012 Author Posted February 3, 2012 the problem is not from the value or outputchatbox .. i put outputchatbox to know what is the element i just care about (( if gotexp2 == 1 then )) it's always 1 even when i change the value in onMapStarting تيم سبيك بروجيمر ts3server://ts.pg.sa
Kenix Posted February 3, 2012 Posted February 3, 2012 /reconnect and try again. Show full code. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Castillo Posted February 3, 2012 Posted February 3, 2012 function rankk( ) local gotexp2 = tonumber( getElementData( source,"exp212" ) or 0 ) if gotexp2 == 1 then -- you can use if some then instand of if ( some ) then outputChatBox( tostring( gotexp2 ) ) -- gotexp2 is number value convert to string --outputChatBox( "*sorry",source,0,255,0,true ) -- why true ? Need use false see in arguments function outputChatBox( "*sorry",source,0,255,0 ) else --outputChatBox("ok",source,0,255,0,false ) -- same outputChatBox( "ok",source,0,255,0 ) setElementData( source,"exp212",1 ) end end addEventHandler( "onPlayerWasted",root,rankk ) function new( ) setElementData( source,"exp212",0 ) local alvw = getElementData( source,"exp212" ) -- variable alvw is number outputChatBox( tostring( alvw ) ) -- convert to string end addEvent( "onMapStarting",true) addEventHandler( "onMapStarting",root,new ) SolidShake14,Your code is wrong ... P.S Tabulate your code in next time. P.S See in /debugscript 3 P.S Code updated. That's just useless, true and false in outputChatBox will just enable and disable the HEX color codes. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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