• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Mangos TBC summall players

Status
Not open for further replies.

ALILP

Emulation Addict
Code:
--[[player:SummonPlayer( target, map, x, y, z, zoneId )]]
function summall(event, player, msg)
if(player:GetGmRank() =< 3)then
if(msg lower() == "#summall")then
for A, D in ipairs(GetPlayersInWorld()) do
local Map = D:GetMapId()
local X = D:GetX
local Y = D:GetY
local Z = D:GetZ
local Zone = D:GetZoneId
player:SummonPlayer( D, Map, X, Y, Z, Zone )
end
end
end
end

RegisterPlayerEvent(18, summall)
I wrote this it should summ all players but it doesnt work.
where is my fault?
 
Last edited:

Rochet2

Moderator / Eluna Dev
Moved to support.

What errors are you getting?
This seems like a bad copy paste or something since the functions are not called properly. A lot of () and : is missing.
 

ALILP

Emulation Addict
Code:
--[[player:SummonPlayer( target, map, x, y, z, zoneId )]]
function summall(event, player, message, Type, lang)
if(player:GetGmRank() < 3)then
if(message:lower() == "#summall")then
for A, D in ipairs(GetPlayersInWorld()) do
local Map = D:GetMapId()
local X = D:GetX
local lol = D:GetY
local Z = D:GetZ
local Zone = D:GetZoneId
player:SummonPlayer( D, Map, X, lol, Z, Zone )
end
end
end
end

RegisterPlayerEvent(18, summall)
Error loading `lua_scripts/trainer.lua`
lua_scripts/trainer.lua:8: function arguments expected near 'local'
 

Rochet2

Moderator / Eluna Dev
D:GetX should be D:GetX() because D is a player and GetX is a method (member function) and you are calling it.
Same thing should be done for all the other function calls you make that are missing the parenthesis.
 

ALILP

Emulation Addict
:~(

Code:
--[[player:SummonPlayer( target, map, x, y, z, zoneId )]]
function summall(event, Player, message, Type, lang)
if(player:GetGmRank() < 3)then
if(message:lower() == "#summall")then
for A, D in ipairs(GetPlayersInWorld()) do
local Map = D:GetMapId()
local X = D:GetX()
local Y = D:GetY()
local Z = D:GetZ()
local Zone = D:GetZoneId
Player:SummonPlayer( D, Map, X, Y, Z, Zone )
end
end
end
end

RegisterPlayerEvent(18, summall)
now Error is :
Error loading `lua_scripts/trainer.lua`
lua_scripts/trainer.lua:11: function arguments expected near 'Player'
 

ALILP

Emulation Addict
Solved
Code:
Code:
--[[player:SummonPlayer( target, map, x, y, z, zoneId )]]
function summall(event, player, message, Type, lang)
if(player:GetGmRank() < 3)then
if(message:lower() == "summall")then
for A, D in ipairs(GetPlayersInWorld()) do
local Map = player:GetMapId()
local X = player:GetX()
local Y = player:GetY()
local Z = player:GetZ()
local Zone = player:GetZoneId()
player:SummonPlayer(D,Map,X,Y,Z,Zone)
end
end
end
end

RegisterPlayerEvent(42, summall)
 
Status
Not open for further replies.
Top