Human immunity problem
#1

Alright, so as the title says, i have a problem that i've been trying to fix by my own withour positive result.. The problem is that i can't make a class immune to only ONE kind of zombies, so i've tried to make it like this right here.

PHP код:
    if(PRESSED(KEY_WALK))
    {
        if(
team[playerid] == TEAM_ZOMBIE)
        {
            if(
pInfo[playerid][pZombieClass] == ADVSTOMPER)
            {
                if(
gettime() - 10 Abilitys[playerid][StomperPushing]) return GameTextForPlayer(playerid,"~w~ Still recovering",1000,5);
                {
                    new 
Float:x,Float:y,Float:z,Float:Angle;
                    new 
Float:hp;
                    
GetPlayerPos(playerid,Float:x,Float:y,Float:z);
                    
GetPlayerFacingAngle(playerid,Float:Angle);
                    foreach(
Player,i)
                    {
                          switch(
GetPlayerSkin(i))
                        {
                               case 
NON_IMMUNE,100:
                            {
                                if(
GetDistanceBetweenPlayers(playerid,i) < 8.0)
                                {
                                    if(
pInfo[i][pVipLevel] == 0)
                                    {
                                        if(
pInfo[i][pHumanClass] == MIB)
                                        {
                                            
SendClientMessage(playerid,-1,"This player cannot be stomped");
                                        }
                                        else
                                        {
                                            
GetClosestPlayer(i);
                                            
GetPlayerFacingAngle(i,Float:Angle);
                                            
GetPlayerVelocity(i,Float:x,Float:y,Float:z);
                                            
SetPlayerVelocity(i,Float:x+0.3,Float:y+0.3,Float:z+0.2);
                                            
SetPlayerFacingAngle(i,Float:Angle);
                                            
GetPlayerHealth(i,hp);
                                            
SetPlayerHealth(i,hp -10);
                                            
GivePlayerXP(playerid,20);
                                            
Abilitys[playerid][StomperPushing] = gettime();
                                        }
                                    }
                                    else if(
pInfo[i][pVipLevel] >= 1)
                                    {
                                        
SendClientMessage(playerid,-1,"This Player is Immune");
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    } 
This is just one of my tries to make it.. What happens when i use this? Its immune to ALL zombies, not only the one that i want, if you have any ideea in how to fix this or alteast what should i do, please help me

EDIT: I've managed to solved this by my own, thanks. <3
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)