.............. . . . . < ---- Player in middle . . ...............
if(PRESSED(KEY_WALK))
{
if(gTeam[playerid] == TEAM_ZOMBIE)
{
if(Classes[playerid][StomperZombie] == 1)
{
if(iInfo[playerid][StomperPush] == 1)
{
new Float:x,Float:y,Float:z,Float:angle;
GetPlayerVelocity(playerid,Float:x,Float:y,Float:z);
GetPlayerPos(playerid,Float:x,Float:y,Float:z);
GetPlayerFacingAngle(playerid,Float:angle);
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,Float:x,Float:y,Float:z))
{
GetPlayerVelocity(i,Float:x,Float:y,Float:z);
SetPlayerVelocity(i,Float:x+0.2,Float:y+0.2,Float:z+0.1);
SetPlayerFacingAngle(i,Float:angle);
}
}
}
}
iInfo[playerid][StomperPush] = 0;
SetTimerEx("StomperReset",7000,0,"i",playerid);
}
else
{
GameTextForPlayer(playerid,"~g~ Still recovering",4000,5);
}
}
}
}
Definition of foreach use:
foreach (new i : Player) { printf("%d", i); } Maybe this help. |
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);
}
}
}
}