Jump to content

Realdriveby para determinado ACL


LPM//Bruno

Recommended Posts

Posted

Hola como están , estoy editando el script de realdriveby para que solo pueda ser utilizado por usuarios VIP en mi servidor (ACL: VIPs) el problema es que no sé por qué no funciona la forma en la cual lo estoy haciendo, intente con variables comunes y triggers desde el servidor hacia el cliente y hasta con setElementData y getElementData, nada sirvió, el script se inicia y no muestra ningún error (con debugscript 3 activo) y deniega el acceso al realdriveby todo el tiempo (como si el player no estuviese en el ACL VIPs a comprobar, pero en realidad si está); espero puedan ayudarme.

driveby_client.lua (Cortado, solo inserte aqui las funciones que yo agrege al script original)

local driver = false
local shooting = false
local helpText,helpAnimation
lastSlot = 0
settings = {}
usuarioVip = false

addEvent ( "activarUsuarioVip", true )
addEventHandler("activarUsuarioVip",getRootElement(),
	function()
	usuarioVip = true
	end
)


local function setupDriveby( player, seat )
if usuarioVip == true then
		outputChatBox("[LPM-VIP] Puedes disparar desde el vehiculo.",0,255,0,true) 
		bindKey ( "mouse2", "down", "Toggle Driveby", "" )
		bindKey ( "e", "down", "Next driveby weapon", "1" )
		bindKey ( "q", "down", "Previous driveby weapon", "-1" )
		toggleControl ( "vehicle_next_weapon",false )
		toggleControl ( "vehicle_previous_weapon",false )
		helpText = dxText:create("",0.5,0.85)
		helpText:scale(1)
		helpText:type("stroke",1)
			--If his seat is 0, store the fact that he's a driver
	if seat == 0 then 
		driver = true
	else
		driver = false
	end
	--By default, we set the player's equiped weapon to nothing.
	setPedWeaponSlot( localPlayer, 0 )
	if settings.autoEquip then
		toggleDriveby()
	end
else 
outputChatBox("[LPM] Si deseas disparar desde el vehiculo compra una cuenta VIP en www.mtalpm.com",255,255,0,true) 
return end
end
addEventHandler( "onClientPlayerVehicleEnter", localPlayer, setupDriveby )

 

 

driveby_server.lua (Cortado, solo inserte aqui las funciones que yo agrege al script original)

function verificarVIP ( )
	local cuenta = getAccountName( getPlayerAccount(client) )
	
	if isObjectInACLGroup("user."..cuenta, aclGetGroup("VIPs")) then
		triggerClientEvent ( client, "activarUsuarioVip", client )
	else
		
	end
	
end
addEventHandler("onClientResourceStart", getRootElement(), verificarVIP)

 

Posted
6 minutes ago, #Dv^ said:

Estás usando el evento onClientResourceStart del lado del servidor, cuando claramente va del lado del cliente

Es onResourceStart solamente no? xD

Posted

Sí, de todas formas ese script nunca funcionaría por que está mal hecho, principalmente todo esto
 

function verificarVIP ( )
	local cuenta = getAccountName( getPlayerAccount(client) )
	
	if isObjectInACLGroup("user."..cuenta, aclGetGroup("VIPs")) then
		triggerClientEvent ( client, "activarUsuarioVip", client )
	else
		
	end
	
end
addEventHandler("onResourceStart", getRootElement(), verificarVIP)

 

  • Like 1
Posted
10 hours ago, #Dv^ said:

Sí, de todas formas ese script nunca funcionaría por que está mal hecho, principalmente todo esto
 


function verificarVIP ( )
	local cuenta = getAccountName( getPlayerAccount(client) )
	
	if isObjectInACLGroup("user."..cuenta, aclGetGroup("VIPs")) then
		triggerClientEvent ( client, "activarUsuarioVip", client )
	else
		
	end
	
end
addEventHandler("onResourceStart", getRootElement(), verificarVIP)

 

Y como podría arreglarlo?

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...