Jump to content

Queria saber como se faz isso.


Recommended Posts

Eu sei q n tem q postar duas perguntas no mesmo tópico mas, quando eu crio uma nova função da esse erro

Quote

ERROR: Loading script failed: [scripts]\hab\client.lua:35: '(' expected near 'semHab'

Codigo:

veh = 
addEventHandler("onPlayerVehicleEnter", veh, 
function semHab()
	local nomeacc = getAccountName(getPlayerAccount(player))
		if isObjectInACLGroup("user."..nomeacc, aclGetGroup("Hab")) then
	
		else
			removePedFromVehicle ( source )
	end
end)

 

Link to comment

 

é q tou fazendo um script para q se vc n tiver habilitação vc toma nivel.

addEventHandler("onPlayerVehicleEnter", getRootElement(), 
function (player, source, thePlayer)
	local nomeacc = getAccountName(getPlayerAccount(player))
		if isObjectInACLGroup("user."..nomeacc, aclGetGroup("Hab")) then
			outputChatBox("#000000[#ff0000VDE#000000]Vai tomar no cu fdp", player, 255, 255, 255, true)
		else
			setPlayerWantedLevel ( source, 6 )
			outputChatBox("#000000[#ff0000VDE#000000]#ffffffVocê não tem carteira de habilitação, com isso foi acrescentado 6 estrelas de procurado em você", player, 255, 255, 255, true)
	end
end)

edit: eu só tou tendo erro nisso quando ele entre mesmo estando ou n na acl n aparece nada, não estou na acl e n mostra ali o output

Edited by carlos eduardo
Link to comment
  • Moderators
function enterVehicle ( player, seat, jacked )
	local nomeacc = getAccountName(getPlayerAccount(player))
	if seat ~= 0 then return end;
	if isObjectInACLGroup("user."..nomeacc, aclGetGroup("Hab")) then
		outputChatBox("#000000[#ff0000VDE#000000]Vai tomar no cu fdp", player, 255, 255, 255, true)
	else
    	cancelEvent()
		setPlayerWantedLevel ( player, 6 )
		outputChatBox("#000000[#ff0000VDE#000000]#ffffffVocê não tem carteira de habilitação, com isso foi acrescentado 6 estrelas de procurado em você", player, 255, 255, 255, true)
	end
end
addEventHandler( "onVehicleStartEnter", getRootElement(), enterVehicle )

Tenta isso.

Edited by DNL291
Link to comment
3 minutes ago, DNL291 said:

function enterVehicle ( player, seat, jacked )
	local nomeacc = getAccountName(getPlayerAccount(player))
	if seat ~= 0 then return end;
	if isObjectInACLGroup("user."..nomeacc, aclGetGroup("Hab")) then
		outputChatBox("#000000[#ff0000VDE#000000]Vai tomar no cu fdp", player, 255, 255, 255, true)
	else
		setPlayerWantedLevel ( player, 6 )
		outputChatBox("#000000[#ff0000VDE#000000]#ffffffVocê não tem carteira de habilitação, com isso foi acrescentado 6 estrelas de procurado em você", player, 255, 255, 255, true)
	end
end
addEventHandler( "onVehicleStartEnter", getRootElement(), enterVehicle )

Tenta isso.

n aconteceu nada, tou pegando o carro do painel 'p' saindo e entrando só q n acontece nada.

 

Link to comment
  • Moderators

function enterVehicle ( player, seat, jacked )
	local nomeacc = getAccountName(getPlayerAccount(player))
	outputChatBox("Executando função: enterVehicle", player)
	outputChatBox("@nomeacc: "..tostring(nomeacc), player)
	outputChatBox("@seat: "..tostring(seat), player)
	if seat ~= 0 then
		outputChatBox("Você está entrando como passageiro", player)
	elseif seat == 0 then
		outputChatBox("entrando como Motorista", player)
	end;
	if isObjectInACLGroup("user."..nomeacc, aclGetGroup("Hab")) then
		outputChatBox("#000000[#ff0000VDE#000000]Vai tomar no cu fdp", player, 255, 255, 255, true)
	else
		cancelEvent()
		setPlayerWantedLevel ( player, 6 )
		outputChatBox("#000000[#ff0000VDE#000000]#ffffffVocê não tem carteira de habilitação, com isso foi acrescentado 6 estrelas de procurado em você", player, 255, 255, 255, true)
	end
end
addEventHandler( "onVehicleStartEnter", getRootElement(), enterVehicle )

Mostre aqui as msgs que aparecerem no chat.

Link to comment
6 minutes ago, DNL291 said:

function enterVehicle ( player, seat, jacked )
	local nomeacc = getAccountName(getPlayerAccount(player))
	outputChatBox("Executando função: enterVehicle", player)
	outputChatBox("@nomeacc: "..tostring(nomeacc), player)
	outputChatBox("@seat: "..tostring(seat), player)
	if seat ~= 0 then
		outputChatBox("Você está entrando como passageiro", player)
	elseif seat == 0 then
		outputChatBox("entrando como Motorista", player)
	end;
	if isObjectInACLGroup("user."..nomeacc, aclGetGroup("Hab")) then
		outputChatBox("#000000[#ff0000VDE#000000]Vai tomar no cu fdp", player, 255, 255, 255, true)
	else
		cancelEvent()
		setPlayerWantedLevel ( player, 6 )
		outputChatBox("#000000[#ff0000VDE#000000]#ffffffVocê não tem carteira de habilitação, com isso foi acrescentado 6 estrelas de procurado em você", player, 255, 255, 255, true)
	end
end
addEventHandler( "onVehicleStartEnter", getRootElement(), enterVehicle )

Mostre aqui as msgs que aparecerem no chat.

n aparece nada no /debugscript 3 e nem no chat

edit:Tou entrando agoran os carro que spawna sozinho

 

Edited by carlos eduardo
Link to comment
44 minutes ago, DNL291 said:

Então o script não está executando. Pode ser que tenha erro no meta.xml, o script não está iniciado ou você não ativou o debug (/debugscript 3) e algo está errado no código.

o script ta executando tanto que essa parte ta funcionando:

function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font,checkBuildings,checkVehicles,checkPeds,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)
				local x, y, z = getElementPosition(TheElement)
				local x2, y2, z2 = getElementPosition(localPlayer)
				local distance = distance or 20
				local height = height or 1
                                local checkBuildings = checkBuildings or true
                                local checkVehicles = checkVehicles or false
                                local checkPeds = checkPeds or false
                                local checkObjects = checkObjects or true
                                local checkDummies = checkDummies or true
                                local seeThroughStuff = seeThroughStuff or false
                                local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false
                                local ignoredElement = ignoredElement or nil
				if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then
					local sx, sy = getScreenFromWorldPosition(x, y, z+height)
					if(sx) and (sy) then
						local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
						if(distanceBetweenPoints < distance) then
							dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 220, G or 230, B or 240, alpha or 250), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center")
			end
		end
	end
end

MarkC = createMarker(1791.5272216797, -1163.9146728516, 22.928125, "cylinder",2,255,0,0,180)

addEventHandler("onClientRender", getRootElement(), 
function ()
dxDrawTextOnElement(MarkC,"Colegio",1,20,0,0,255,255,1,"pricedown")
end)

 

Link to comment
  • Moderators

Esse código é do lado client então não tem a ver com o outro. Você colocou o script no meta.xml?

13 minutes ago, gustavorn said:

Também é provável que os grupos da acl estejam bugado ou corrompidos.

Se fosse os grupos bugados, Ex: o grupo Hab faltando ou com o nome incorreto; ou a ACL não funcionando, ainda assim seria executado os outputChatBox's e se não tivesse mostrando nada no chat, com certeza teria erro no debug.

Edited by DNL291
Link to comment
1 minute ago, DNL291 said:

Esse código é do lado client então não tem a ver com o outro. Você colocou o script no meta.xml?

Se fosse os grupos bugados, Ex: o grupo Hab faltando ou com o nome incorreto; ou a ACL não funcionando, ainda assim seria executado os outputChatBox's e se não tivesse mostrando, com certeza teria erro no debug.

nem eu entendo oq ta acontecendo

 

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