Radius of circle?
#3

Quote:
Originally Posted by Azazelo
Посмотреть сообщение
Definition of foreach use:

foreach (new i : Player)
{
printf("%d", i);
}

Maybe this help.
His way of using foreach is fine, I always use it like that too so I actually think the way you're telling it it doens't work ( Maybe it does, I'm not sure, but I am sure the way he uses it works. ).
I don't really see something wrong in the code, but you could try this to start with this:
pawn Код:
if(PRESSED(KEY_WALK))
{
    if(gTeam[playerid] == TEAM_ZOMBIE)
        {
        if(Classes[playerid][StomperZombie] == 1)
            {
            if(iInfo[playerid][StomperPush] == 1)
                {
                new Float:Vx,Float:Vy,Float:Vz, Float:Px, Float: Py, Float:Pz, Float:Angle;
                GetPlayerPos(playerid, Px, Py, Pz);
                foreach(Player, i)
                    {
                    GetClosestPlayer(i);
                    if(IsPlayerConnected(i))
                        {
                        new skinid = GetPlayerSkin(i);
                        if(skinid == 2 || skinid == 5 || skinid == 21 || skinid == 260 || skinid == 281 || skinid == 287 || skinid == 230 || skinid == 274 || skinid == 29 || skinid == 179 || skinid == 27 || skinid == 276 || skinid == 22 || skinid == 22 || skinid == 56 || skinid == 108 || skinid == 165)
                            {
                            if(IsPlayerInRangeOfPoint(i,4.3, Px, Py, Pz))
                                {
                                GetPlayerFacingAngle(i, Angle);
                                GetPlayerVelocity(i, Vx, Vy, Vz);
                                SetPlayerVelocity(i, Vx+0.2, Vy+0.2, Vz+0.1);
                                SetPlayerFacingAngle(i, Angle);
                                }
                            }
                        }
                    }
                iInfo[playerid][StomperPush] = 0;
                SetTimerEx("StomperReset",7000,0,"i",playerid);
                }
             else
                {
                GameTextForPlayer(playerid,"~g~ Still recovering",4000,5);
                }
            }
        }
}
Best regards,
Jesse
Reply


Messages In This Thread
Radius of circle? - by Kitten - 24.05.2012, 00:47
Re: Radius of circle? - by Azazelo - 24.05.2012, 01:04
Re: Radius of circle? - by jessejanssen - 24.05.2012, 01:35
Re: Radius of circle? - by MP2 - 24.05.2012, 02:23

Forum Jump:


Users browsing this thread: 2 Guest(s)