Jump to content

[Help] how will source


djharbi2

Recommended Posts

Client-Side 

addEventHandler("onClientKey",getRootElement(),
function(button,press)
	if press then
		if (button == "lalt" and getKeyState("k")) or (button == "k" and getKeyState("lalt")) then
			triggerServerEvent("command:execute",resourceRoot,"up")
		elseif (button == "lalt" and getKeyState("o")) or (button == "o" and getKeyState("lalt")) then
			triggerServerEvent("command:execute",resourceRoot,"sit")
		end
	end
end)

Server-Side

addEvent("command:execute",true)
addEventHandler("command:execute",resourceRoot,
function(position)
	if position=="sit" then
	animationCommand()
	elseif position=="up" then
	animationCommand2()
	end
end)

function animationCommand ( source )
setPedAnimation ( source, "ped", "SEAT_idle", -1, true, false, false )
end

function animationCommand2 ( source )
setPedAnimation ( source )
end

your bass is not working, so I did not help pls

Link to comment
  • Moderators
animationCommand(client)
animationCommand2(client)

 

 

function animationCommand ( player )
	setPedAnimation ( player, "ped", "SEAT_idle", -1, true, false, false )
end

function animationCommand2 ( player )
	setPedAnimation ( player )
end

 

Do not abuse the source variable.

 

  • Like 1
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...