SA-MP Forums Archive
Help with the new Class. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with the new Class. (/showthread.php?tid=593015)



Help with the new Class. - Ercha - 31.10.2015

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!


Re: Help with the new Class. - sanamalik400 - 01.11.2015

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,,,


Re: Help with the new Class. - D1am0nd - 01.11.2015

Delete


Re: Help with the new Class. - Ercha - 01.11.2015

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


Re: Help with the new Class. - sanamalik400 - 01.11.2015

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);
}
}
}
}




Re: Help with the new Class. - sanamalik400 - 01.11.2015

worked (checking Signature)