Estevam2d Posted January 26, 2015 Share Posted January 26, 2015 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
Estevam2d Posted January 26, 2015 Author Share Posted January 26, 2015 someone help me? Link to comment
LaCosTa Posted January 26, 2015 Share Posted January 26, 2015 make the trigger event like this triggerClientEvent ( source,"Chamarseeds", source) Link to comment
Estevam2d Posted January 26, 2015 Author Share Posted January 26, 2015 thank you for the tip triggerEvent. I have a problem that when I enter the cylinder window appears for all, there is something that can evitalo appear for all and also appear just for me? Link to comment
xXMADEXx Posted January 26, 2015 Share Posted January 26, 2015 thank you for the tip triggerEvent.I have a problem that when I enter the cylinder window appears for all, there is something that can evitalo appear for all and also appear just for me? You need to put an if statement in the code, to check if the player who hit the marker is the localPlayer. onClientMarkerHit triggers whenever any player hits the marker. Link to comment
Estevam2d Posted January 27, 2015 Author Share Posted January 27, 2015 thanks again managed to do. 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