Jump to content

HELP Scripting


IsmaelRD

Recommended Posts

Me gustaría Que funciona Por a acl y que tengas que poner un comando para activarlo o solo acl 
 

I would like that it works by acl and that you have to put a command to activate it or just acl
 

Lado del cliente

function stopDamage ()
        cancelEvent()
end
addEventHandler ( "onClientPlayerDamage", getRootElement(), stopDamage )
addEventHandler ( "onClientPlayerStealthKill", getRootElement(), stopDamage )
addEventHandler ( "onClientPedDamage", getRootElement(), stopDamage )
 

Lado del cliente

function stopDamage ()
        cancelEvent()
end
addEventHandler ( "onClientPlayerDamage", getRootElement(), stopDamage )
addEventHandler ( "onClientPlayerStealthKill", getRootElement(), stopDamage )
addEventHandler ( "onClientPedDamage", getRootElement(), stopDamage )

Link to comment
  • 2 weeks later...
On 19/04/2023 at 21:52, IsmaelRD said:

Me gustaría Que funciona Por a acl y que tengas que poner un comando para activarlo o solo acl 
 

I would like that it works by acl and that you have to put a command to activate it or just acl
 

Lado del cliente

function stopDamage ()
        cancelEvent()
end
addEventHandler ( "onClientPlayerDamage", getRootElement(), stopDamage )
addEventHandler ( "onClientPlayerStealthKill", getRootElement(), stopDamage )
addEventHandler ( "onClientPedDamage", getRootElement(), stopDamage )
 

Lado del cliente

function stopDamage ()
        cancelEvent()
end
addEventHandler ( "onClientPlayerDamage", getRootElement(), stopDamage )
addEventHandler ( "onClientPlayerStealthKill", getRootElement(), stopDamage )
addEventHandler ( "onClientPedDamage", getRootElement(), stopDamage )

client-side :
 

local godMode = false --godmode status
function stopDamage()
   if(godMode) then --cancel damage if godmode is on
      cancelEvent()
   end
end
addEventHandler("onClientPlayerDamage", root, stopDamage)
addEventHandler("onClientPlayerStealthKill", root, stopDamage)
addEventHandler("onClientPedDamage", root, stopDamage)


addEvent("setGodMode",true) --an event to set godmode
addEventHandler("setGodMode",root,
  function(value)
     godMode = value
  end
)

server-side:
 

addEventHandler("onPlayerLogin", root, 
   function(_,account)
      local accName = getAccountName(account)    
      if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then --if player's account is in Admin group make it godmode
         triggerClientEvent(source, "setGodMode", source, true)
      else
         triggerClientEvent(source, "setGodMode", source, false) --if not, turn off godmode
      end
   end
)

 

Link to comment

I try to cancel the ban event by the admin_server.lua it happens that if it works but it cancels it for everyone and I only want it for me this is the script that I am using for me and a friend, the script gets the name we are with registered on the server and cancel the event for these two accounts wilmertrobert and joan26
 

local plAcc = getPlayerAccount(player)
    if plAcc then
      if getAccountName(plAcc) == "wilmertrobert" or getAccountName(plAcc) == "joan26" then
      return
   end
end
 

I would really appreciate your help

Link to comment
22 minutes ago, IsmaelRD said:

I try to cancel the ban event by the admin_server.lua it happens that if it works but it cancels it for everyone and I only want it for me this is the script that I am using for me and a friend, the script gets the name we are with registered on the server and cancel the event for these two accounts wilmertrobert and joan26
 

local plAcc = getPlayerAccount(player)
    if plAcc then
      if getAccountName(plAcc) == "wilmertrobert" or getAccountName(plAcc) == "joan26" then
      return
   end
end
 

I would really appreciate your help

If you could retrieve the whole function of this ban "cancel", it would be useful.

Link to comment
49 minutes ago, Lavi said:

If you could retrieve the whole function of this ban "cancel", it would be useful.

what do you need I don't understand

On 03/05/2023 at 16:24, Shady1 said:

client-side :
 

local godMode = false --godmode status
function stopDamage()
   if(godMode) then --cancel damage if godmode is on
      cancelEvent()
   end
end
addEventHandler("onClientPlayerDamage", root, stopDamage)
addEventHandler("onClientPlayerStealthKill", root, stopDamage)
addEventHandler("onClientPedDamage", root, stopDamage)


addEvent("setGodMode",true) --an event to set godmode
addEventHandler("setGodMode",root,
  function(value)
     godMode = value
  end
)

server-side:
 

addEventHandler("onPlayerLogin", root, 
   function(_,account)
      local accName = getAccountName(account)    
      if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then --if player's account is in Admin group make it godmode
         triggerClientEvent(source, "setGodMode", source, true)
      else
         triggerClientEvent(source, "setGodMode", source, false) --if not, turn off godmode
      end
   end
)

 

it does not work

52 minutes ago, Lavi said:

If you could retrieve the whole function of this ban "cancel", it would be useful.

I don't understand what you need if you are asking for it they work completely I don't have it I only have that

Link to comment
20 hours ago, IsmaelRD said:

what do you need I don't understand

it does not work

I don't understand what you need if you are asking for it they work completely I don't have it I only have that

I mean, you are talking about cancelling the ban event found in the admin_server.lua you have. If you can provide the ban "event" function this resource uses, we can help you to cancel the event. Maybe you are not finding something right but with the information you have given its pretty hard to give you a solid answer.

Link to comment
19 hours ago, Lavi said:

I mean, you are talking about cancelling the ban event found in the admin_server.lua you have. If you can provide the ban "event" function this resource uses, we can help you to cancel the event. Maybe you are not finding something right but with the information you have given its pretty hard to give you a solid answer.

I'll give you my admin.server.lua so you can help me with that
https://pastebin.multitheftauto.com/3534212547

Link to comment
1 hour ago, IsmaelRD said:

I'll give you my admin.server.lua so you can help me with that
https://pastebin.multitheftauto.com/3534212547

You added lots of these all over your code (which seem right to "disable" the use of the commands over these accounts).

local plAcc = getPlayerAccount(player)
	if plAcc then
		if getAccountName(plAcc) == "wilmertrobert" or getAccountName(plAcc) == "joan26" then
		return
	end
end

But you forgot to add it to "ban" command, thats why it doesnt work. Just make sure to add what you already wrote but after the ban else statement.

Link to comment
2 hours ago, Lavi said:

You added lots of these all over your code (which seem right to "disable" the use of the commands over these accounts).

local plAcc = getPlayerAccount(player)
	if plAcc then
		if getAccountName(plAcc) == "wilmertrobert" or getAccountName(plAcc) == "joan26" then
		return
	end
end

But you forgot to add it to "ban" command, thats why it doesnt work. Just make sure to add what you already wrote but after the ban else statement.

Can you send me the complete code, that is, where should I place it please, if it's not too much to ask

2 hours ago, Lavi said:

You added lots of these all over your code (which seem right to "disable" the use of the commands over these accounts).

local plAcc = getPlayerAccount(player)
	if plAcc then
		if getAccountName(plAcc) == "wilmertrobert" or getAccountName(plAcc) == "joan26" then
		return
	end
end

But you forgot to add it to "ban" command, thats why it doesnt work. Just make sure to add what you already wrote but after the ban else statement.

It works but the problem is that when I put it, it cancels the event for all users on the server

Edited by IsmaelRD
Link to comment
15 hours ago, IsmaelRD said:

Can you send me the complete code, that is, where should I place it please, if it's not too much to ask

It works but the problem is that when I put it, it cancels the event for all users on the server

I edited your code, deleted all those unnecesary verifications and left only one at the start of the function. I left two tables before the function so you can add accounts and the commands you want to be not used against you. If it still doesn't work it might be something else. (You might want to check /debugscript 3).

Code:
https://pastebin.multitheftauto.com/6224386920

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