Jump to content

Ajuda aqui galera.


Recommended Posts

function blockJoin(player)
	if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("SAMU")) then
	    if getPedOccupiedVehicle(player) then 
	    	setElementPosition(getPedOccupiedVehicle(player), 1983.74536, -1465.94702, 13.39063)
	    end
		setElementPosition(player, 1983.74536, -1465.94702, 13.39063)
		exports.dxmessages:outputDx(player, "Você não pode entrar aqui!", "error")
	end
end
addEventHandler("onColShapeHit", rBlock, blockJoin)

Há algum erro nestas linhas? no debugscript 3 está dando "expected element at argument 1, got nil" para o GetAccountName e "Expected Account at argument 1, got bolean", ajudem por favor galera, agradeço desde já!

Link to comment
function blockJoin (thePlayer)
  	local acc = getPlayerAccount (thePlayer)
	if not isObjectInACLGroup ( "user." ..getAccountName(acc), aclGetGroup ("SAMU")) then
	    if getPedOccupiedVehicle(thePlayer) then 
	    	setElementPosition(getPedOccupiedVehicle(thePlayer), 1983.74536, -1465.94702, 13.39063)
	    end
		setElementPosition(thePlayer, 1983.74536, -1465.94702, 13.39063)
		exports.dxmessages:outputDx(thePlayer, "Você não pode entrar aqui!", "error")
	end
end
addEventHandler("onColShapeHit", rBlock, blockJoin)

 

Edited by OverKILL
  • Thanks 1
Link to comment
1 hour ago, Imortallity said:

function blockJoin(player)
	if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("SAMU")) then
	    if getPedOccupiedVehicle(player) then 
	    	setElementPosition(getPedOccupiedVehicle(player), 1983.74536, -1465.94702, 13.39063)
	    end
		setElementPosition(player, 1983.74536, -1465.94702, 13.39063)
		exports.dxmessages:outputDx(player, "Você não pode entrar aqui!", "error")
	end
end
addEventHandler("onColShapeHit", rBlock, blockJoin)

Há algum erro nestas linhas? no debugscript 3 está dando "expected element at argument 1, got nil" para o GetAccountName e "Expected Account at argument 1, got bolean", ajudem por favor galera, agradeço desde já!

Você não definiu o getAccountName, ou seja, não definiu seu parâmetro. 
~ O exemplo do @OverKILL deve servir. 

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