31.10.2015, 23:50
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.
Thanks in advance for the help!
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() - 6 < 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();
}
}
}
}
}
}
}
}