Deepu Posted February 24, 2014 Posted February 24, 2014 local marker = createMarker(2483.900390625, -1666.7001953125, 13.3, "cylinder", 1, 255, 2, 0) function theThing () pro = getElementData(localPlayer, "Drugs") if pro == 0 then noob = setElementData(localPlayer, "Drugs", 1) + pro padappa() end end addCommandHandler("drugs", theThing) function padappa () dxDrawText(""..pro.."", 507, 466, 786, 569, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false) end addEventHandler("onClientRender", root, padappa) it says attempt to concatenate pro( a boolean value) WANT SCRIPTS? I SELL LIKE AN ANIMATED CUSTOMISED GUI FOR 5USD AND AN RPG GAMEMODE FOR 30USD ONLY. IF YOU NEED SPECIAL SCRIPTS THEN I SELL EACH FOR 5 USD.
Castillo Posted February 24, 2014 Posted February 24, 2014 function padappa ( ) dxDrawText ( tostring ( pro ), 507, 466, 786, 569, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false ) end addEventHandler ( "onClientRender", root, padappa ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Deepu Posted February 24, 2014 Author Posted February 24, 2014 hmmm but castillo, it outputs in the screen in a dxdrawtext as "nil" its written nil in screen WANT SCRIPTS? I SELL LIKE AN ANIMATED CUSTOMISED GUI FOR 5USD AND AN RPG GAMEMODE FOR 30USD ONLY. IF YOU NEED SPECIAL SCRIPTS THEN I SELL EACH FOR 5 USD.
Moderators Citizen Posted February 24, 2014 Moderators Posted February 24, 2014 Use /drugs and it won't be nil anymore The rEvolution is coming ...
Deepu Posted February 24, 2014 Author Posted February 24, 2014 when I do /drugs it says false WANT SCRIPTS? I SELL LIKE AN ANIMATED CUSTOMISED GUI FOR 5USD AND AN RPG GAMEMODE FOR 30USD ONLY. IF YOU NEED SPECIAL SCRIPTS THEN I SELL EACH FOR 5 USD.
Deepu Posted February 24, 2014 Author Posted February 24, 2014 http://imgur.com/vjebYRF http://imgur.com/oi7wGRM WANT SCRIPTS? I SELL LIKE AN ANIMATED CUSTOMISED GUI FOR 5USD AND AN RPG GAMEMODE FOR 30USD ONLY. IF YOU NEED SPECIAL SCRIPTS THEN I SELL EACH FOR 5 USD.
Moderators Citizen Posted February 24, 2014 Moderators Posted February 24, 2014 First wrong reply It's your fault, replace if pro == 0 then by if not pro then EDIT: Ok wait, what /drugs should do ? I don't really understand what you tried to do. I think I got it: replace this: pro = getElementData(localPlayer, "Drugs") by this: pro = getElementData(localPlayer, "Drugs") or 0 The rEvolution is coming ...
Deepu Posted February 24, 2014 Author Posted February 24, 2014 what does that mean? the ones u showed WANT SCRIPTS? I SELL LIKE AN ANIMATED CUSTOMISED GUI FOR 5USD AND AN RPG GAMEMODE FOR 30USD ONLY. IF YOU NEED SPECIAL SCRIPTS THEN I SELL EACH FOR 5 USD.
Deepu Posted February 24, 2014 Author Posted February 24, 2014 how can I tell that : if pro == 1 or more then setElementData(localPlayer, "drugs", pro + 1 more) how do I do that in lua code? WANT SCRIPTS? I SELL LIKE AN ANIMATED CUSTOMISED GUI FOR 5USD AND AN RPG GAMEMODE FOR 30USD ONLY. IF YOU NEED SPECIAL SCRIPTS THEN I SELL EACH FOR 5 USD.
WhoAmI Posted February 24, 2014 Posted February 24, 2014 setElementData(localPlayer, "drugs", getElementData(localPlayer, "drugs") + 1)
Moderators Citizen Posted February 24, 2014 Moderators Posted February 24, 2014 how can I tell that :if pro == 1 or more then setElementData(localPlayer, "drugs", pro + 1 more) how do I do that in lua code? local currentDrugs = getElementData(localPlayer, "drugs") or 0 setElementData(localPlayer, "drugs", currentDrugs + 1) The rEvolution is coming ...
Deepu Posted February 25, 2014 Author Posted February 25, 2014 hmmm..... it works but uh how can I like in a marker if a player stands then he gets the amount of drugs that he enters in the gui edit box. I don't know if its 1 or 5 or 8. depends on the number he writes in gui's edit box any answers citizen? WANT SCRIPTS? I SELL LIKE AN ANIMATED CUSTOMISED GUI FOR 5USD AND AN RPG GAMEMODE FOR 30USD ONLY. IF YOU NEED SPECIAL SCRIPTS THEN I SELL EACH FOR 5 USD.
Karuzo Posted February 25, 2014 Posted February 25, 2014 Use guiGetTex for it. local currentDrugs = getElementData(localPlayer, "drugs") or 0 editbox = guiCreateEditBox(.....) drugss = guiGetTex(editbox) setElementData(localPlayer, "drugs", currentDrugs+drugss) Wrote this on the phone.
Anubhav Posted February 25, 2014 Posted February 25, 2014 KRZO I know you wrote on phone. I will correct it. local currentDrugs = getElementData(localPlayer, "drugs") or 0 editbox = guiCreateEdit(.....) drugss = guiGetText(editbox) setElementData(localPlayer, "drugs", currentDrugs+drugss) See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Deepu Posted February 25, 2014 Author Posted February 25, 2014 yeah I made it it worked but uh... I have to do /drugs amount and /drugs again to make it to the number local marker = createMarker(2483.900390625, -1666.7001953125, 13.3, "cylinder", 1, 255, 2, 0) function theThing (cmd, Number) currentDrugs = getElementData(localPlayer, "drugs") or 0 noob = setElementData(localPlayer, "drugs", currentDrugs + Number) end addCommandHandler("drugs", theThing) function padappa ( ) dxDrawText ( tostring ( currentDrugs ), 507, 466, 786, 569, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false ) end addEventHandler ( "onClientRender", root, padappa ) WANT SCRIPTS? I SELL LIKE AN ANIMATED CUSTOMISED GUI FOR 5USD AND AN RPG GAMEMODE FOR 30USD ONLY. IF YOU NEED SPECIAL SCRIPTS THEN I SELL EACH FOR 5 USD.
myonlake Posted February 25, 2014 Posted February 25, 2014 Use tonumber( ) to make it a number value. local marker = createMarker( 2483.900390625, -1666.7001953125, 13.3, "cylinder", 1, 255, 2, 0 ) local drugCount = 0 addCommandHandler( "drugs", function( cmd, amount ) local amount = tonumber( amount ) if ( amount ) and ( amount > 0 ) then local currentDrugs = tonumber( getElementData( localPlayer, "drugs" ) ) or 0 drugCount = currentDrugs + amount setElementData( localPlayer, "drugs", drugCount ) else outputChatBox( "SYNTAX: /" .. cmd .. " [amount]", 220, 185, 20, false ) end end ) addEventHandler( "onClientRender", root, function( ) dxDrawText( tostring( drugCount ), 507, 466, 786, 569, tocolor( 255, 255, 255, 255 ), 1.00, "default", "left", "top", false, false, true, false, false ) end ) If I helped you, please click the like button on the right Thanks!
Deepu Posted February 25, 2014 Author Posted February 25, 2014 how to show that if the text in edit box is a number then set the number ? WANT SCRIPTS? I SELL LIKE AN ANIMATED CUSTOMISED GUI FOR 5USD AND AN RPG GAMEMODE FOR 30USD ONLY. IF YOU NEED SPECIAL SCRIPTS THEN I SELL EACH FOR 5 USD.
myonlake Posted February 25, 2014 Posted February 25, 2014 Use tonumber( ) like I did above. If I helped you, please click the like button on the right Thanks!
Saml1er Posted February 25, 2014 Posted February 25, 2014 If you want to get numbers from édit box then use: drugss = tonumber ( guiGetText(editbox) ) This will convert "" into number for example, "10" into 10
Deepu Posted February 25, 2014 Author Posted February 25, 2014 k thanks I will check if it no work i ask WANT SCRIPTS? I SELL LIKE AN ANIMATED CUSTOMISED GUI FOR 5USD AND AN RPG GAMEMODE FOR 30USD ONLY. IF YOU NEED SPECIAL SCRIPTS THEN I SELL EACH FOR 5 USD.
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