How to fix explosion after death (PROBLEM) -
Pokemon64 - 18.03.2017
Hi
so i go straight to the point problem is that if you're red team your ability is that you get explosion after death, right? So if round is over and starting other you randomly selected now to Blue team so if red team kill you, you get explode bat it shouldn't work like this. Explosion on that only should have red team. So idk whats wrong
I'm pretty sure it would be problem with all OnPlayerDeath callback because off { }
Bat anyway code of ability
Код:
if(pInfo[playerid][pRedClass] == BOOMER)
{
new explodecount;
GetPlayerPos(playerid,Float:x,Float:y,Float:z);
CreateExplosion(Float:x,Float:y,Float:z,0,6.0);
foreach(new i : Player)
{
if(!IsPlayerConnected(i)) continue;
if(i == playerid) continue;
if(pInfo[i][pRedClass] == BOOMER) continue;
if(IsPlayerInRangeOfPoint(i,7.0,Float:x,Float:y,Float:z))
{
if(pInfo[i][IsPlayerInfected] == 0)
{
InfectPlayerStandard(i);
explodecount++;
}
}
}
if(explodecount > 0)
{
new zmstring2[256],pNames[MAX_PLAYER_NAME];
GetPlayerName(playerid,pNames,sizeof(pNames));
format(zmstring2,sizeof(zmstring2),""COL_GREEN"%s has been exploded "COL_WHITE"%i players.",pNames,explodecount);
SendClientMessageToAll(-1,zmstring2);
}
}
}
If you no see any problem here send me private message because i dont want drop all "OnPlayerDeath" callback here.
Re: How to fix explosion after death (PROBLEM) -
lackmail - 18.03.2017
do you change pRedClass from BOOMER to another thing when player selected in blue team?
Re: How to fix explosion after death (PROBLEM) -
Pokemon64 - 18.03.2017
No i dont. It saved i think. Because if next round you will be again Red team so BOOMER class will stay until you dont change it. So somehow need remove that ability if you are in Blue team. Bat i dont know how
Re: How to fix explosion after death (PROBLEM) -
lackmail - 18.03.2017
then you have to check player team first then check if pRedClass == BOOMER
example:
Код:
if(Team[playerid] == TEAM_RED && pInfo[playerid][pRedClass] == BOOMER)
Re: How to fix explosion after death (PROBLEM) -
henkas - 18.03.2017
Quote:
Originally Posted by lackmail
then you have to check player team first then check if pRedClass == BOOMER
example:
Код:
if(Team[playerid] == TEAM_RED && pInfo[playerid][pRedClass] == BOOMER)
|
It will not work.
Re: How to fix explosion after death (PROBLEM) -
Pokemon64 - 18.03.2017
Quote:
Originally Posted by lackmail
then you have to check player team first then check if pRedClass == BOOMER
example:
Код:
if(Team[playerid] == TEAM_RED && pInfo[playerid][pRedClass] == BOOMER)
|
I tried it already. Nothing changed.
Re: How to fix explosion after death (PROBLEM) -
coool - 18.03.2017
Try
Quote:
if(!pInfo[playerid][pBlueClass] == BOOMER)
|
Within the pRedClass's if statement
Re: How to fix explosion after death (PROBLEM) -
Pokemon64 - 18.03.2017
Quote:
Originally Posted by coool
Try
Within the pRedClass's if statement
|
warning 213: tag mismatch
Re: How to fix explosion after death (PROBLEM) -
coool - 18.03.2017
Can you show how have you put it in and try running that compiled file to see if it works
Re: How to fix explosion after death (PROBLEM) -
Pokemon64 - 18.03.2017
Anyway i tried
if(!pInfo[playerid][pBlueClass] == BOOMER)
It doesnt work.