Quote:
Originally Posted by kovac
Try this:
PHP код:
stock countFactionMembers(factionid)
{
new count;
foreach (new i : Player)
{
if(pl[i][pMember] == factionid || pl[i][pLeader] == factionid)
{
count++;
}
}
return count;
}
I'm not sure what "number" is so I left it as it was
PHP код:
new amount = strval(inputtext)
foreach (new i : Player)
{
if(pl[i][pMember]==number||pl[i][pLeader]==number)
{
GivePlayerMoney(i, amount/2);
}
}
Hope this will help you
EDIT: I assume that you already have included foreach.
|
That wouldn't satisfy his requirements. You're dividing the amount of money entered by 2 instead of the number of online faction members. & I'm not sure why you included countFactionMembers if you're not going to use it in your command.