Jump to content

question


Recommended Posts

Posted

How do you give health?

- command

- GUI

- marker/object/other events

Almost everytime I've replied, I have told you how to make the one simple chatbox message, please, read!

If I helped you, please click the like button on the right ;) Thanks!

Posted

Solidsnake14 vs Evil-Cod3r we Play in my server you have hit me with m-4 -50 of my health

i set my health +50 form the admin panel

i want output a msg called ("evil-Cod3r.. Has Set His Health 50 He Cheat on the Map !!!")

did you get it now?

i wnat you to see the msg if i give my self health or not becuse some players cheat on there server !

i want script Anti-Health Cheat !

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted

Ok, now I understand.

-- client side:

local oldHealth = getElementHealth(localPlayer) 
  
function checkPlayerHealth() 
    local currentHealth = getElementHealth(localPlayer) 
    if (currentHealth ~= oldHealth) then 
        if (oldHealth < currentHealth) then 
            triggerServerEvent("onPlayerHealthChanged",localPlayer,oldHealth,currentHealth) 
        end 
        oldHealth = currentHealth 
    end 
end 
addEventHandler("onClientPreRender",root,checkPlayerHealth) 

-- server side:

addEvent("onPlayerHealthChanged",true) 
addEventHandler("onPlayerHealthChanged",root, 
    function (old, new) 
        outputChatBox(getPlayerName(source) .." has set his health from ".. old .." to ".. new .." he cheated on the map!",root,255,0,0) 
    end 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

yes yes yes yes yes thank god Man !

you have made it but what if the admin give another player health dos it show on the chat ??

local name = getPlayerName(admin) 
local him = getPlayerName(source) 
local value = getElementHealth() 
function show () 
if (admin give player health and the Player got the health ) then 
outputChatBox(name.. "Has Give .. him .. value .. of Health") 
end 
addEventHandler ( "onResourceStart", getRootElement(), show) 

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted

Copy my script again, I've fixed a bug.

And about your question, no, you can't know who changed the player health.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

last thing this what i mean

---serverSide

addEvent("onPlayerHealthChanged",true) 
addEventHandler("onPlayerHealthChanged",root, 
    function (old, new) 
        outputChatBox(getPlayerName(source) .. "Has Set(getPlayerName(source) health from ".. old .." to ".. new ..",root,255,0,0) 
    end 
) 
 

---clientSide

local oldHealth = getElementHealth(localPlayer) 
  
function checkPlayerHealth() 
    local currentHealth = getElementHealth(localPlayer) 
    if (currentHealth ~= oldHealth) then 
        if (oldHealth < currentHealth) then 
            triggerServerEvent("onPlayerHealthChanged",localPlayer,oldHealth,currentHealth) 
        end 
        oldHealth = currentHealth 
    end 
end 
addEventHandler("onClientPreRender",root,checkPlayerHealth) 

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted

As I told you, you can't know who set the health of the player.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Ok Thanx all for helpin me iam sorry to make you tired with me sorry :(

Close :Topic:

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted

just find the function in the resource u have that sets the health of the player and add it there.

(admin panel? admin_server.lua - halfway down the script - add the line there)

ScoobySig.gif

[UVA]Scooby

Founder Of UVA - Ultimate Vice Assassins

http://www.uvaclan.com/

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