format(zmstring,sizeof(zmstring), ""chat""COL_PINK" %s has been infected by %s",PlayerName(victimid),PlayerName(playerid)); SendClientMessageToAll(-1,zmstring);
if(PRESSED(KEY_WALK))
{
if(team[playerid] == TEAM_ZOMBIE)
{
if(pInfo[playerid][pZombieClass] == ADVANCEDBOOMER)
{
if(IsPlayerInRangeOfPoint(playerid,8.0,Map[ZombieSpawnX],Map[ZombieSpawnY],Map[ZombieSpawnZ]))
{
GameTextForPlayer(playerid,"~r~You cant explode yourself near zombie spawn!",4000,5);
}
else
{
new victimid = GetClosestPlayer(playerid);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,Float:x,Float:y,Float:z);
SetPlayerHealth(playerid,0.0);
CreateExplosion(Float:x,Float:y,Float:z,0,6.0);
foreach(new i : Player)
{
GetClosestPlayer(i);
if(IsPlayerConnected(i))
{
switch(GetPlayerSkin(i))
{
case NON_IMMUNE:
{
if(IsPlayerInRangeOfPoint(i,7.0,Float:x,Float:y,Float:z))
{
if(pInfo[i][IsPlayerInfected] == 0)
{
new zmstring[256];
InfectPlayerStandard(i);
format(zmstring,sizeof(zmstring), ""chat""COL_PINK" %s has been infected by %s",PlayerName(victimid),PlayerName(playerid));
SendClientMessageToAll(-1,zmstring);
}
if(PRESSED(KEY_WALK))
{
new infectedcount;
if(team[playerid] == TEAM_ZOMBIE)
{
if(pInfo[playerid][pZombieClass] == ADVANCEDBOOMER)
{
if(IsPlayerInRangeOfPoint(playerid,8.0,Map[ZombieSpawnX],Map[ZombieSpawnY],Map[ZombieSpawnZ]))
{
GameTextForPlayer(playerid,"~r~You cant explode yourself near zombie spawn!",4000,5);
}
else
{
new victimid = GetClosestPlayer(playerid);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,Float:x,Float:y,Float:z);
SetPlayerHealth(playerid,0.0);
CreateExplosion(Float:x,Float:y,Float:z,0,6.0);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i,7.0,Float:x,Float:y,Float:z))
{
if(pInfo[i][IsPlayerInfected] == 0)
{
new zmstring[256],zmstring2[256],pName[MAX_PLAYER_NAME];
infectedcount++;
InfectPlayerStandard(i);
GetPlayerName(playerid,pName,sizeof(pName));
format(zmstring,sizeof(zmstring), ""chat""COL_PINK" %s has been infected by %s",PlayerName(victimid),PlayerName(playerid));
format(zmstring2,sizeof(zmstring2),"%s has infected %i players.",pName,infectedcount);
SendClientMessageToAll(-1,zmstring);
SendClientMessageToAll(-1,zmstring2);
}
|
Try this one, not tested.
Replace it instead of your current code. Код:
if(PRESSED(KEY_WALK))
{
new infectedcount;
if(team[playerid] == TEAM_ZOMBIE)
{
if(pInfo[playerid][pZombieClass] == ADVANCEDBOOMER)
{
if(IsPlayerInRangeOfPoint(playerid,8.0,Map[ZombieSpawnX],Map[ZombieSpawnY],Map[ZombieSpawnZ]))
{
GameTextForPlayer(playerid,"~r~You cant explode yourself near zombie spawn!",4000,5);
}
else
{
new victimid = GetClosestPlayer(playerid);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,Float:x,Float:y,Float:z);
SetPlayerHealth(playerid,0.0);
CreateExplosion(Float:x,Float:y,Float:z,0,6.0);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i,7.0,Float:x,Float:y,Float:z))
{
if(pInfo[i][IsPlayerInfected] == 0)
{
new zmstring[256],zmstring2[256],pName[MAX_PLAYER_NAME];
infectedcount++;
InfectPlayerStandard(i);
GetPlayerName(playerid,pName,sizeof(pName));
format(zmstring,sizeof(zmstring), ""chat""COL_PINK" %s has been infected by %s",PlayerName(victimid),PlayerName(playerid));
format(zmstring2,sizeof(zmstring2),"%s has infected %i players.",pName,infectedcount);
SendClientMessageToAll(-1,zmstring);
SendClientMessageToAll(-1,zmstring2);
}
|
GetClosestPlayer(i);
if(IsPlayerConnected(i))
{
switch(GetPlayerSkin(i))
{
case NON_IMMUNE:
{
|
Try this one, not tested.
Replace it instead of your current code. Код:
if(PRESSED(KEY_WALK))
{
new infectedcount;
if(team[playerid] == TEAM_ZOMBIE)
{
if(pInfo[playerid][pZombieClass] == ADVANCEDBOOMER)
{
if(IsPlayerInRangeOfPoint(playerid,8.0,Map[ZombieSpawnX],Map[ZombieSpawnY],Map[ZombieSpawnZ]))
{
GameTextForPlayer(playerid,"~r~You cant explode yourself near zombie spawn!",4000,5);
}
else
{
new victimid = GetClosestPlayer(playerid);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,Float:x,Float:y,Float:z);
SetPlayerHealth(playerid,0.0);
CreateExplosion(Float:x,Float:y,Float:z,0,6.0);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i,7.0,Float:x,Float:y,Float:z))
{
if(pInfo[i][IsPlayerInfected] == 0)
{
new zmstring[256],zmstring2[256],pName[MAX_PLAYER_NAME];
infectedcount++;
InfectPlayerStandard(i);
GetPlayerName(playerid,pName,sizeof(pName));
format(zmstring,sizeof(zmstring), ""chat""COL_PINK" %s has been infected by %s",PlayerName(victimid),PlayerName(playerid));
format(zmstring2,sizeof(zmstring2),"%s has infected %i players.",pName,infectedcount);
SendClientMessageToAll(-1,zmstring);
SendClientMessageToAll(-1,zmstring2);
}
|