Please help with the 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: Please help with the class! (
/showthread.php?tid=630340)
Please help with the class! -
D1am0nd - 12.03.2017
Hello! I'm currently creating a zombie class which will be like ''Tanker'' and it's ability is to stomp any near player away. I have this hunter class, but it doesn't have to interact with other players, because it jumps and Tanker has to like punch a player.
Here is how hunter class works:
PHP код:
if(Key(KEY_JUMP) && gTeam[playerid] == gZOMBIE && PlayerInfo[playerid][gSpecialZed] == zedHUNTER && g_GlobalStatus == e_Status_Playing)
{
new tick = GetTickCount() + 3600000;
if((PlayerInfo[playerid][tickLastJump] + COOLDOWN_JUMP) >= tick)
{
return 1;
}
new Float:POS[3];
GetPlayerVelocity(playerid, POS[0], POS[1], POS[2]);
SetPlayerVelocity(playerid, POS[0], POS[1], floatadd(POS[2], 1.5));
PlayerInfo[playerid][tickLastJump] = tick;
}
Basically I need a help with Velocity position coordinates and the target player. Any help is very appreciated. Thank you!
Please note, that this is not an ordinary zombie apocalypse script and I am scripting a different one, so I don't want to copy-paste.
Re: Please help with the class! -
Nero_3D - 13.03.2017
A stomp, so players around the "tanker" are pushed back?
For finding the targets you need to loop through the players and check if they are in range of the stomp
For the push back you set the targets velocity in the correct direction (away from "tanker")