Jump to content

weed planting ^^


Estevam2d

Recommended Posts

I have a big problem.

When I use / plant, all my friends Also plant.

How do I get only the plantation Appear for me?

I do not want to Appear to weed for all

Just who use the command will plant and not all

side - Client

weeddID = 3409 
weeddGrowTime = 5000 
pacot = 1578 
upe = 128.2 
esx = 4.2 
  
  
  
  
  
  
  
addEvent("Chamarseeds",true) 
function teste() 
if getElementData ( localPlayer, "WeedBag" ) == 1 then 
 local x,y,z = getElementPosition(localPlayer) 
            Feno1 = createObject(weeddID,x,y,z-esx)                  
            moveObject(Feno1,weeddGrowTime,x,y,upe,0,0,0,"InOutQuad")    
             
            setTimer(function()  
            destroyElement (Feno1) 
            pacotin1 = createObject(pacot,x,y,z-1.0) 
            end,weeddGrowTime,1) 
end 
end 
addEventHandler("Chamarseeds", getRootElement(), teste) 

side - Server

  
function Bandidobymanawydan (source) 
triggerClientEvent ( "Chamarseeds", source)  
outputChatBox("Seeds "..getElementData(source,"WeedBag").." " ,source,255,0,0) 
end 
addCommandHandler("plant",  Bandidobymanawydan) 
  
  
  
  
--Cigarettes 
addEventHandler ( 'onPlayerQuit', root, 
    function ( ) 
        local account = getPlayerAccount ( source ) 
        local getScore = getElementData ( source, 'WeedBag' ) or 0 
        if ( account ) and not ( isGuestAccount ( account ) ) then 
            setAccountData ( account, 'WeedBag', getScore ) 
        end 
    end 
) 
addEventHandler ( 'onPlayerLogin', root, 
    function ( _, account ) 
        if ( account ) then 
            local scoreLoad = getAccountData ( account, 'WeedBag' ) 
            if ( scoreLoad ) then 
                setElementData ( source, 'WeedBag', scoreLoad ) 
            end 
        end 
    end 
) 

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...