Jump to content

this thing in the pic.....


Deepu

Recommended Posts

How do you this thing? I made the rest of my farmer job I need the one like this :

in the right corner down there is "Seeds: 0" and when I click the 50 seeds button then it changes to "seeds: 50" how do I do that?

and also when I Plant some seeds, there comes a counter ====> " 1/50" "2/50" and at last when its "50/50" it says "you're out of seeds"

How do I do that thing?

Also please teach me

here is the pics

http://imgur.com/stMUCPG

http://imgur.com/7GAhHC9

http://imgur.com/4bYNyAD

http://imgur.com/e9CyC9V

http://imgur.com/FL8XV2w

and thanks in advance and its so urgent I want the answer by tommorrow

thanks again and please ITS VERY URGENT SORRY FOR THE DIFFICULTIES YOU FACED IN HELPING ME

Link to comment

You can use dxDrawText to draw 2D text on the screen. Render it with onClientRender event client-side and you can use a variable or player's element data to output the current amount of seeds. When they click the button on the GUI, it will increase the amount of seeds by changing the value of the variable or player's element data. When they hit the max, it will disable the button.

That marker is a custom marker created with dxDrawLine3D. I wouldn't suggest spending time on making that, because I think it's difficult for you to understand the mathematical algorithms behind it. Feel free to try if you want to, I can assure you the algorithm is interesting to implement in MTA and see it work. I made a simple 2D outline circle system myself, it was fun to make despite all the problems I faced when trying to find out the best way to do it.

Link to comment

We don't make scripts for you. You must do them yourself, find a scripter to do it for you for some price, or find it from the community.

You should read the links included in my post. Rendering automatically "updates" the data you do, because it renders it again each frame. This way you won't have to worry about updating the dxDrawText. Also, about the seeds, like I said, you can use variables or element data to save the seed amount.

You can use guiGetScreenSize to get the screen width and height and calculate the position of the text relative to the scale.

Link to comment
man, you think I don't know scripting? nopee. I have made 50 scripts and sold them for free :)

i never done this seeds data update thing before so I asked

cuz I already made farmer job

He wasn't saying you didn't know scripts, he was just saying he doesn't write scripts for free.

The dxDrawText will update every-render, example:

addEventHandler ( "onClientRender", root, function ( ) 
     dxDrawText ( tostring ( getElementData ( localPlayer, "Job" ) ), 0, 0, 0, 0 ) 
end ) 

In the code, for example, any time the "Job" data would change for localPlayer, it would automatically update the text.

Link to comment

I will show you the script alright Made?

addEventHandler("onClientRender", root, 
    function() 
        dxDrawText("Seeds : 0", 697, 580, 842, 652, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 697, 578, 842, 650, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 695, 580, 840, 652, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 695, 578, 840, 650, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 696, 579, 841, 651, tocolor(248, 245, 14, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
    end 
) 
  
  
function theTractor () 
   triggerServerEvent("onChoot", thePlayer) 
end 
addEventHandler("onClientMarkerHit", markerB, theTractor) 
  
  
function A (hitElement) 
   if hitElement == thePlayer then 
     if isPedInVehicle(thePlayer) then 
        if isElementWithinMarker(hitElement, markerA) then 
        aa = createMarker(x + 5,y,z - 1, "cylinder", 2, 255, 2, 0, 255) 
        
  
addEventHandler("onClientRender", root, 
    function() 
        dxDrawText("1/50", 699, 394, 852, 514, tocolor(224, 238, 16, 255), 2.00, "default-bold", "left", "top", false, false, true, false, false) 
        dxDrawText("TAKE A COMBINE HARVESTER WHEN READY ", 533, 448, 635, 477, tocolor(182, 130, 5, 255), 1.00, "default", "left", "top", false, false, true, false, false) 
        dxDrawText("Seeds : 49", 673, 482, 881, 546, tocolor(195, 226, 20, 255), 1.50, "default-bold", "left", "top", false, false, true, false, false) 
    end 
) 
  
        end 
     end 
   end 
end 

you can edit that now/?

Link to comment

I will show you the script alright Made?

addEventHandler("onClientRender", root, 
    function() 
        dxDrawText("Seeds : 0", 697, 580, 842, 652, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 697, 578, 842, 650, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 695, 580, 840, 652, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 695, 578, 840, 650, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 696, 579, 841, 651, tocolor(248, 245, 14, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
    end 
) 
  
  
function theTractor () 
   triggerServerEvent("onChoot", thePlayer) 
end 
addEventHandler("onClientMarkerHit", markerB, theTractor) 
  
  
function A (hitElement) 
   if hitElement == thePlayer then 
     if isPedInVehicle(thePlayer) then 
        if isElementWithinMarker(hitElement, markerA) then 
        aa = createMarker(x + 5,y,z - 1, "cylinder", 2, 255, 2, 0, 255) 
        
  
addEventHandler("onClientRender", root, 
    function() 
        dxDrawText("1/50", 699, 394, 852, 514, tocolor(224, 238, 16, 255), 2.00, "default-bold", "left", "top", false, false, true, false, false) 
        dxDrawText("TAKE A COMBINE HARVESTER WHEN READY ", 533, 448, 635, 477, tocolor(182, 130, 5, 255), 1.00, "default", "left", "top", false, false, true, false, false) 
        dxDrawText("Seeds : 49", 673, 482, 881, 546, tocolor(195, 226, 20, 255), 1.50, "default-bold", "left", "top", false, false, true, false, false) 
    end 
) 
  
        end 
     end 
   end 
end 

you can edit that now/?

Link to comment

look at this .....

addEventHandler("onClientRender", root, 
    function() 
        dxDrawText("Seeds : 0", 697, 580, 842, 652, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 697, 578, 842, 650, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 695, 580, 840, 652, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 695, 578, 840, 650, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 696, 579, 841, 651, tocolor(248, 245, 14, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
    end 
) 
  
  
function theTractor () 
   triggerServerEvent("onChoot", thePlayer) 
end 
addEventHandler("onClientMarkerHit", markerB, theTractor) 
  
  
function A (hitElement) 
   if hitElement == thePlayer then 
     if isPedInVehicle(thePlayer) then 
        if isElementWithinMarker(hitElement, markerA) then 
        aa = createMarker(x + 5,y,z - 1, "cylinder", 2, 255, 2, 0, 255) 
        
  
addEventHandler("onClientRender", root, 
    function() 
        dxDrawText("1/50", 699, 394, 852, 514, tocolor(224, 238, 16, 255), 2.00, "default-bold", "left", "top", false, false, true, false, false) 
        dxDrawText("TAKE A COMBINE HARVESTER WHEN READY ", 533, 448, 635, 477, tocolor(182, 130, 5, 255), 1.00, "default", "left", "top", false, false, true, false, false) 
        dxDrawText("Seeds : 49", 673, 482, 881, 546, tocolor(195, 226, 20, 255), 1.50, "default-bold", "left", "top", false, false, true, false, false) 
        dxDrawText ( tostring ( getElementData ( localPlayer, "Job" ) ), 0, 0, 0, 0 ) 
    end 
) 
  
        end 
     end 
   end 
end 
addEventHandler("onClientMarkerHit", markerA, A) 

it doesnt work

what I want is that I wanna replace the Seeds: 0 thing in the first function

it doesnt replace seeds with the new one

:(

Link to comment

Why should he ? I mean if you have sold 50 scripts for "free" , you could do that easily.

He said what you have to do, just use a variable or a element-data .

I mean he spents such time to link everything for you. You just have to click on the links, and voila, you have an example :o

Link to comment
Why should he ? I mean if you have sold 50 scripts for "free" , you could do that easily.

He said what you have to do, just use a variable or a element-data .

I mean he spents such time to link everything for you. You just have to click on the links, and voila, you have an example :o

Why you post if you no want to help this guy ? to get +1 post ? omg.. :roll:

Link to comment
addEventHandler("onClientRender", root, 
    function() 
        dxDrawText("Seeds : 0", 697, 580, 842, 652, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 697, 578, 842, 650, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 695, 580, 840, 652, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 695, 578, 840, 650, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 696, 579, 841, 651, tocolor(248, 245, 14, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
    end 
) 
  

ok?

now this is the edit I am thinking off but doesnt work

Told ya I am new to getElementData ()

I know those getPlayerCount and all

look

local pup = getElementData(thePlayer, "jobs") 

then

I did

addEventHandler ( "onClientRender", root, function ( ) 
     dxDrawText ( tostring ( getElementData ( thePlayer, "Job" ) ), 0, 0, 0, 0 ) 
end ) 

it doesnt work -.-

Told you -.- I dunno abt getElementData without you showing an ex: I have read wiki :)

Link to comment

KRZO you know abt this? frankly speaking Do you? if you know please help by giving examples or editing mine cuz This is not the script that I am going to use or sell or give or do somthng

its for me to make another script like this but not this a totally differnet one got it friendly helpers?

Link to comment
KRZO said:
No,

im just sayin. He wants examples?

myonlake linked every function so he has an example.

Btw, you say im tryin' to get +1 post more ? You double posted.

hahaha :lol: Funny.

If this guy not understand the wiki extample , then give him your extample , tell him something about it . If you know something about it KOZO , i'm 100% sure you not. :roll:

Link to comment

What do you mean with onClientRender() changes it ?

Let me give you an example how you could change the dxDrawing :

  
function ZeroSeeds() 
    dxDrawText("Seeds : 0", 697, 580, 842, 652, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 697, 578, 842, 650, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 695, 580, 840, 652, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 695, 578, 840, 650, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 0", 696, 579, 841, 651, tocolor(248, 245, 14, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
end 
  
function MoreSeeds() 
    dxDrawText("Seeds : 50", 697, 580, 842, 652, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 50", 697, 578, 842, 650, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 50", 695, 580, 840, 652, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 50", 695, 578, 840, 650, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
        dxDrawText("Seeds : 50", 696, 579, 841, 651, tocolor(248, 245, 14, 255), 1.00, "default-bold", "left", "top", true, true, true, true, false) 
end 
  
function open() 
opened = not opened 
if opened == true then 
addEventHandler("onClientRender", getRootElement(), ZeroSeeds) 
else 
removeEventHandler("onClientRender", getRootElement(), ZeroSeeds) 
addEventHandler("onClientRender", getRootElement(), MoreSeeds) 
end 
end 
addEventHandler("onClientMarkerHit", marker, open) 
  

Just an example.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...