19.03.2018, 12:33
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.
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.
PHP Code:
if(PRESSED(KEY_WALK))
{
if(team[playerid] == TEAM_ZOMBIE)
{
if(pInfo[playerid][pZombieClass] == SLENDER)
{
new Float:pz, Float:x, Float:y, Float:z;
new targetid = GetClosestPlayer(playerid);
GetPlayerFacingAngle(playerid, pz);
GetPlayerPos(playerid, Float:x, Float:y, Float: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.0, 1, 0, 0, 0, 0);
ApplyAnimation(targetid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); //Apply it twice!
TogglePlayerControllable(targetid, 0);
SetTimerEx("ClearAnims", 2000, 0, "i", targetid);
new nemesisstring[128];
format(nemesisstring,sizeof(nemesisstring),""chat" You have been attacked by Slender %s",PlayerName(playerid));
SendClientMessage(targetid,-1,nemesisstring);
}
}
}
}
}
}