Not sure if this will work, but;
function drogas(thePlayer, theCommand)
if not (getPlayerMoney(thePlayer) >= 100) then
outputChatBox( "Você deve ter $100 ou mais para usar este comando.", thePlayer, 220, 0, 0)
else
takePlayerMoney(thePlayer, 100)
outputChatBox( "#FFFF00Você gastou 100$ em 1 pedra de CRACK!", thePlayer, 255, 255, 0)
setPedArmor(thePlayer, 97)
setElementHealth(thePlayer, 30)
outputChatBox("Você usou Drogas!", thePlayer, 255, 255, 255)
local daBlockz = getElementData(thePlayer, "blockz")
local daAnmiz = getElementData(thePlayer, "animz")
if not (daBlockz == "crack") and not (daAnimx == "Bbalbat_Idle_02") then
setPedAnimation(thePlayer, "CRACK", "Bbalbat_Idle_02")
setElementData(thePlayer, "blockz", "crack")
setElementData(thePlayer, "animz", "Bbalbat_Idle_02")
else
setPedAnimation(thePlayer, false)
setElementData(thePlayer, "blockz", false)
setElementData(thePlayer, "animz", false)
end
end
end
addCommandHandler( "drogas", drogas )
function onClientPlayerEnterVehicle ( theVehicle, seat, jacked )
setTimer ( onClientPlayerEnterVehicle()
toggleControl ( "accelerate", false ) -- disable the accelerate key
toggleControl ( "brake_reverse", false ) -- disable the brake_reverse key
toggleControl ( "handbrake", false ) -- disable the handbrake key
setControlState ( "accelerate", true ) -- force the accelerate key on
outputChatBox ( "Efeito das Drogas Passou" )
end, 5000, 1 )
end
addEventHandler ( "onClientPlayerVehicleEnter", getRootElement(), onClientPlayerEnterVehicle )