Finding team players
Finding team players
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?
- GreatEmerald
- CH Staff
- Posts: 3330
- Joined: 24 Jul 2009
- Location: Netherlands
oh, right sorry, my game is Heroes of might and magic V:Tribes of the east, 3.1
here's another script, it's error is that it shows as if the exist[] would be nil...
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...
Who is online
Users browsing this forum: No registered users and 4 guests