How to fix explosion after death (PROBLEM)
#1

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.
Reply
#2

do you change pRedClass from BOOMER to another thing when player selected in blue team?
Reply
#3

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
Reply
#4

then you have to check player team first then check if pRedClass == BOOMER

example:
Код:
if(Team[playerid] == TEAM_RED && pInfo[playerid][pRedClass] == BOOMER)
Reply
#5

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.
Reply
#6

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.
Reply
#7

Try
Quote:

if(!pInfo[playerid][pBlueClass] == BOOMER)

Within the pRedClass's if statement
Reply
#8

Quote:
Originally Posted by coool
Посмотреть сообщение
Try

Within the pRedClass's if statement
warning 213: tag mismatch
Reply
#9

Can you show how have you put it in and try running that compiled file to see if it works
Reply
#10

Anyway i tried
if(!pInfo[playerid][pBlueClass] == BOOMER)
It doesnt work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)