24.05.2012, 01:35
Quote:
Definition of foreach use:
foreach (new i : Player) { printf("%d", i); } Maybe this help. |
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);
}
}
}
}
Jesse