Finding team players

Maps and the art of mapmaking.
tofiffe
Peasant
Peasant
Posts: 93
Joined: 21 Mar 2010

Finding team players

Unread postby tofiffe » 18 Jun 2011, 07:13

Recently i have started making a spell, that would teleport you to main hero of another player, that is in the same team as you are, the problem i have encountered is: how do you get player IDs from a PLAYERFLT_TEAM_x?

User avatar
GreatEmerald
CH Staff
CH Staff
Posts: 3330
Joined: 24 Jul 2009
Location: Netherlands

Unread postby GreatEmerald » 19 Jun 2011, 18:54

And the game you are talking about is?...

User avatar
jeff
Moderator
Moderator
Posts: 3741
Joined: 06 Jan 2006

Unread postby jeff » 19 Jun 2011, 19:34

GreatEmerald wrote:And the game you are talking about is?...
This is a big problem in this forum, far too many people assume we know the game they are discussing. :disagree: Really they need to put it in the title so the ones familiar with that game can find it and help them.
Mala Ipsa Nova :bugsquash:

tofiffe
Peasant
Peasant
Posts: 93
Joined: 21 Mar 2010

Unread postby tofiffe » 22 Jun 2011, 15:43

oh, right sorry, my game is Heroes of might and magic V:Tribes of the east, 3.1
exist[8]={0,0,0,0,0,0,0,0};

function infiniteTurn(set)
local enabled=0;
while not nil do
if enabled==1 then
for i=1,8 do
checkExist(i);
sleep(200);
if exist>=1 then
AddMPtoAllHeroesForPlayer(PLAYER..i);
end;
end;
end;
end;
end;

function checkExist(pid)
local x=GetPlayerHeroes(PLAYER_..pid);
for i=0, length(x) do
if IsObjectExist(x) then
exist[pid]=exist[pid]+1;
end;
end;
end;

function AddMPtoAllHeroesForPlayer(pid)
local x=GetPlayerHeroes(pid)
for i=0,length(x) do
ChangeHeroStat(x, STAT_MOVE_POINTS, 10000);
end;
end;


here's another script, it's error is that it shows as if the exist[] would be nil...


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 4 guests