Help with the new Class.
#1

Hello. I want to create a new class and it will be a Zombie class. Basically, I want that zombie class to have ability, when he hit a player, that player fly for example 10 meters away.


I can show you the example of other Zombie class, which have ability to stomp players away. By pressing LALT, it throws those players away, who were near him. But for the new zombie class which I want, it must hit only ONE player, who you hitted with fist.

PHP код:
if(PRESSED(KEY_WALK))
    {
        if(
team[playerid] == TEAM_ZOMBIE)
        {
            if(
pInfo[playerid][pZombieClass] == STOMPERZOMBIE)
            {
                if(
gettime() - Abilitys[playerid][StomperPushing]) return GameTextForPlayer(playerid,"~w~ Still recovering",1000,5);
                {
                    new 
Float:x,Float:y,Float:z,Float:Angle;
                    
GetPlayerPos(playerid,Float:x,Float:y,Float:z);
                    
GetPlayerFacingAngle(playerid,Float:Angle);
                    foreach(
Player,i)
                    {
                          switch(
GetPlayerSkin(i))
                        {
                               case 
NON_IMMUNE,163,70:
                            {
                                if(
GetDistanceBetweenPlayers(playerid,i) < 6.0)
                                {
                                    
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);
                                    
GivePlayerXP(playerid,10);
                                    
Abilitys[playerid][StomperPushing] = gettime();
                                }
                            }
                        }
                    }
                }
            }
        }
    } 
Thanks in advance for the help!
Reply


Messages In This Thread
Help with the new Class. - by Ercha - 31.10.2015, 23:50
Re: Help with the new Class. - by sanamalik400 - 01.11.2015, 06:03
Re: Help with the new Class. - by D1am0nd - 01.11.2015, 07:58
Re: Help with the new Class. - by Ercha - 01.11.2015, 08:00
Re: Help with the new Class. - by sanamalik400 - 01.11.2015, 12:55
Re: Help with the new Class. - by sanamalik400 - 01.11.2015, 15:00

Forum Jump:


Users browsing this thread: 1 Guest(s)