Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] Show the whole function?

[DiscordArchive] Show the whole function?

[DiscordArchive] Show the whole function?

Pages (11): 1 2 3 4 5 11 Next  
rektbyfaith
Administrator
0
09-27-2023, 01:35 PM
#1
Archived author: Honey • Posted: 2023-09-27T13:35:09.167000+00:00
Original source

Show the whole function?
Is player a player object?
rektbyfaith
09-27-2023, 01:35 PM #1

Archived author: Honey • Posted: 2023-09-27T13:35:09.167000+00:00
Original source

Show the whole function?
Is player a player object?

rektbyfaith
Administrator
0
09-27-2023, 01:35 PM
#2
Archived author: Trojan • Posted: 2023-09-27T13:35:18.720000+00:00
Original source

```lua
local function PlayerDeath(event, player, killer)
if player:HasItem(666, 1) then
-- Get Player Information
local playerGUID = player:GetGUIDLow()
local playerName = player:GetName()
local playerLevel = player:GetLevel()

-- Check if the player is in the "HardCore" guild
local guild = player:GetGuild()
if guild and guild:GetName() == "HardCoded" then
guildBig GrineleteMember(player, false)
SendWorldMessage("|cFFffffffHardcore|r : |cFF007bf6" .. playerName .. " was removed from the Hardcore Guild!|r")
end

local players = GetPlayersInWorld()
local killerName = ""
if killer then
killerName = killer:GetName()
end

-- Broadcast Message to other players in the world
for _, p in ipairs(players) do
p:SendBroadcastMessage("|cFFffffffHardcore|r : |cFFffffffUser |cFF00ff00" .. playerName .. "|r |cFFffffffwas killed by |cFF00ff00" .. killerName .. "|r - |cFFffffffLevel " .. playerLevel .. "")
p:SendAreaTriggerMessage("|cFFffffffHardcore|r : |cFFffffffUser |cFF00ff00" .. playerName .. "|r |cFFffffffwas killed by |cFF00ff00" .. killerName .. "|r - |cFFffffffLevel " .. playerLevel .. "")
end
local input_HC_Dead = "INSERT INTO hc_dead_log (username, level, killer, date, result, guid) VALUES ('" .. player:GetName() .. "', '" .. player:GetLevel() .. "', '" .. killer:GetName() .. "', NOW(), 'DEAD', '" ..playerGUID.."')"
AuthDBExecute(input_HC_Dead)
-- Remove Hardcore Item from player
player:RemoveItem(666, 1)
end
end
```
rektbyfaith
09-27-2023, 01:35 PM #2

Archived author: Trojan • Posted: 2023-09-27T13:35:18.720000+00:00
Original source

```lua
local function PlayerDeath(event, player, killer)
if player:HasItem(666, 1) then
-- Get Player Information
local playerGUID = player:GetGUIDLow()
local playerName = player:GetName()
local playerLevel = player:GetLevel()

-- Check if the player is in the "HardCore" guild
local guild = player:GetGuild()
if guild and guild:GetName() == "HardCoded" then
guildBig GrineleteMember(player, false)
SendWorldMessage("|cFFffffffHardcore|r : |cFF007bf6" .. playerName .. " was removed from the Hardcore Guild!|r")
end

local players = GetPlayersInWorld()
local killerName = ""
if killer then
killerName = killer:GetName()
end

-- Broadcast Message to other players in the world
for _, p in ipairs(players) do
p:SendBroadcastMessage("|cFFffffffHardcore|r : |cFFffffffUser |cFF00ff00" .. playerName .. "|r |cFFffffffwas killed by |cFF00ff00" .. killerName .. "|r - |cFFffffffLevel " .. playerLevel .. "")
p:SendAreaTriggerMessage("|cFFffffffHardcore|r : |cFFffffffUser |cFF00ff00" .. playerName .. "|r |cFFffffffwas killed by |cFF00ff00" .. killerName .. "|r - |cFFffffffLevel " .. playerLevel .. "")
end
local input_HC_Dead = "INSERT INTO hc_dead_log (username, level, killer, date, result, guid) VALUES ('" .. player:GetName() .. "', '" .. player:GetLevel() .. "', '" .. killer:GetName() .. "', NOW(), 'DEAD', '" ..playerGUID.."')"
AuthDBExecute(input_HC_Dead)
-- Remove Hardcore Item from player
player:RemoveItem(666, 1)
end
end
```

rektbyfaith
Administrator
0
09-27-2023, 01:36 PM
#3
Archived author: Trojan • Posted: 2023-09-27T13:36:19.065000+00:00
Original source

yes player is a object. found out when i get killed by another player it works fine
rektbyfaith
09-27-2023, 01:36 PM #3

Archived author: Trojan • Posted: 2023-09-27T13:36:19.065000+00:00
Original source

yes player is a object. found out when i get killed by another player it works fine

rektbyfaith
Administrator
0
09-27-2023, 01:37 PM
#4
Archived author: Honey • Posted: 2023-09-27T13:37:50.395000+00:00
Original source

HasItem exists according to the wiki.
Do a
```lua
print(player:GetGuid())
```
In the line before to check the object?
rektbyfaith
09-27-2023, 01:37 PM #4

Archived author: Honey • Posted: 2023-09-27T13:37:50.395000+00:00
Original source

HasItem exists according to the wiki.
Do a
```lua
print(player:GetGuid())
```
In the line before to check the object?

rektbyfaith
Administrator
0
09-27-2023, 01:38 PM
#5
Archived author: Trojan • Posted: 2023-09-27T13:38:03.873000+00:00
Original source

yes
rektbyfaith
09-27-2023, 01:38 PM #5

Archived author: Trojan • Posted: 2023-09-27T13:38:03.873000+00:00
Original source

yes

rektbyfaith
Administrator
0
09-27-2023, 01:39 PM
#6
Archived author: Honey • Posted: 2023-09-27T13:39:18.465000+00:00
Original source

Did you register the death event?
rektbyfaith
09-27-2023, 01:39 PM #6

Archived author: Honey • Posted: 2023-09-27T13:39:18.465000+00:00
Original source

Did you register the death event?

rektbyfaith
Administrator
0
09-27-2023, 01:39 PM
#7
Archived author: Trojan • Posted: 2023-09-27T13:39:34.039000+00:00
Original source

yes
rektbyfaith
09-27-2023, 01:39 PM #7

Archived author: Trojan • Posted: 2023-09-27T13:39:34.039000+00:00
Original source

yes

rektbyfaith
Administrator
0
09-27-2023, 01:40 PM
#8
Archived author: Honey • Posted: 2023-09-27T13:40:18.384000+00:00
Original source

So it prints the guid now?
Or does the error happen when you do reload eluna?
rektbyfaith
09-27-2023, 01:40 PM #8

Archived author: Honey • Posted: 2023-09-27T13:40:18.384000+00:00
Original source

So it prints the guid now?
Or does the error happen when you do reload eluna?

rektbyfaith
Administrator
0
09-27-2023, 01:40 PM
#9
Archived author: Trojan • Posted: 2023-09-27T13:40:38.414000+00:00
Original source

no i need to restart
rektbyfaith
09-27-2023, 01:40 PM #9

Archived author: Trojan • Posted: 2023-09-27T13:40:38.414000+00:00
Original source

no i need to restart

rektbyfaith
Administrator
0
09-27-2023, 01:40 PM
#10
Archived author: Trojan • Posted: 2023-09-27T13:40:46.266000+00:00
Original source

because reload eluna wont reload the file
rektbyfaith
09-27-2023, 01:40 PM #10

Archived author: Trojan • Posted: 2023-09-27T13:40:46.266000+00:00
Original source

because reload eluna wont reload the file

Pages (11): 1 2 3 4 5 11 Next  
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)