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

set velocity for victim ,, and u dont need any ability
Make It in OnPlayerGiveDamage ,
if u.not understand reply me,, i will make for u,,,
Reply
#3

Delete
Reply
#4

Quote:
Originally Posted by sanamalik400
Посмотреть сообщение
set velocity for victim ,, and u dont need any ability
Make It in OnPlayerGiveDamage ,
if u.not understand reply me,, i will make for u,,,
Can you make for me that please? I would appreciate it..
Reply
#5

i think this will help u.. compile it and post here result
Quote:

if(team[issuerid] == TEAM_ZOMBIE)
{
if(pInfo[issuerid][pZombieClass] == Yourclass)
{
if(team[playerid] == TEAM_HUMAN)
{
if(weaponid == 9)
{
new Float: x,Float:y,Float:z,Float:angle;
GetPlayerFacingAngle(playerid,Float:angle);
GetPlayerVelocity(playerid,Float:x,Float:y,Float:z );

SetPlayerVelocity(playerid,Float:x+0.8,Float:y,Flo at:z+0.8); //// set your own velocity which u want
SetPlayerFacingAngle(playerid,Float:angle);
}
}
}
}

Reply
#6

worked (checking Signature)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)