SA-MP Forums Archive
Zombie 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: Zombie class (/showthread.php?tid=651373)



Zombie class - Graphyt - 19.03.2018

Hello, guys, so i`m struggling at some zombie classes, the bugged ones, and its pretty hard for me since i`m not that old in this domain (Scripting samp) at a higher level, so i have this one here.
PHP Code:
if(PRESSED(KEY_WALK))
    {
        if(
team[playerid] == TEAM_ZOMBIE)
        {
            if(
pInfo[playerid][pZombieClass] == SLENDER)
            {
                new 
Float:pzFloat:xFloat:yFloat:z;
                new 
targetid GetClosestPlayer(playerid);
                
GetPlayerFacingAngle(playeridpz);
                
GetPlayerPos(playeridFloat:xFloat:yFloat:z);
                if(
GetDistanceBetweenPlayers(playerid,targetid) < 10.0)
                {
                    if(
gettime() - 15 Abilitys[playerid][TeleportBlack]) return GameTextForPlayer(playerid,"~r~ You must wait 15 seconds",1000,5);
                    {
                        if(
team[targetid] == TEAM_HUMAN)
                        {
                            
GivePlayerXP(playerid,25);
                            
Abilitys[playerid][TeleportBlack] = gettime();
                            
SendClientMessage(playerid,COLOR_GREEN,"You have teleported to your target and you scared him");
                            
SetPlayerPos(playerid,Float:x,Float:y,Float:z);
                            
ApplyAnimation(targetid"CRACK""crckdeth2"4.010000);
                            
ApplyAnimation(targetid"CRACK""crckdeth2"4.010000); //Apply it twice!
                            
TogglePlayerControllable(targetid0);
                            
SetTimerEx("ClearAnims"20000"i"targetid);
                            new 
nemesisstring[128];
                            
format(nemesisstring,sizeof(nemesisstring),""chat" You have been attacked by Slender %s",PlayerName(playerid));
                            
SendClientMessage(targetid,-1,nemesisstring);
                        }
                    }
                }
            }
        }
    } 
What i want to make? Well, when i press the KEY_WALK, it should teleport the player (that has this class) to the closes target, applying the CRACK animation + his screen turn black, I just cant figure it out.. If its too much what i ask, just ignore it, I don`t want you guys to struggle for me.


Re: [HELP] Zombie class - Graphyt - 20.03.2018

bump


Re: [HELP] Zombie class - Jaxium - 20.03.2018

So what errors are you getting?


Re: [HELP] Zombie class - Graphyt - 20.03.2018

Quote:
Originally Posted by Jaxium
View Post
So what errors are you getting?
There is no error, i want to make that class to teleport to the nearest human and blinding him (Making his screen black)


Re: [HELP] Zombie class - Istrator - 19.04.2018

Well, it's pretty easy. I recommend you to ask Sarcasm on your forums. He is a friend of mine and probably he can fix it.