08.08.2011, 08:33
rather than that I just made some small include, I wont bother releasing it, such a small script..
killstreak.inc
Haven't tested it though should work, all you do is:
Its more tidy though because it uses PVars it'll be slightly inefficient, the point is I don't wanna hook so many functions to reset a variable..
Players can use this inside there GM without even the filterscript.
killstreak.inc
pawn Код:
/*
* Killstreak .inc by Lorenc
*
* - For newbs that cannot be bothered to setup killstreak variables and stuff...
* - IS SO COOL!
*
*
*/
#include <a_samp>
#define KS_SHOW_WA_HAPPEN
#define KILLSTREAK_VAR "killstreak_Killstreak"
forward KillstreakData(playerid, killstreak);
public OnPlayerDeath(playerid, killerid, reason)
{
SetPVarInt( killerid, KILLSTREAK_VAR, GetPVarInt( killerid, KILLSTREAK_VAR ) + 1 );
CallLocalFunction( "KillstreakData", "ddd", killerid, GetPVarInt( killerid, KILLSTREAK_VAR ), playerid);
SetPVarInt( playerid, KILLSTREAK_VAR, 0 );
return CallLocalFunction( "killstreak_OnPlayerDeath", "ddd", playerid, killerid, reason );
}
#if defined _ALS_OnPlayerDeath
#undef OnPlayerDeath
#else
#define _ALS_OnPlayerDeath
#endif
#define OnPlayerDeath killstreak_OnPlayerDeath
forward killstreak_OnPlayerDeath( playerid, killerid, reason );
pawn Код:
public KillstreakData(playerid, killstreak, endedksplayer)
{
/*
- playerid = the person that made this call back call
- killstreak = what killstreak he is on
- endedksplayer = the player 'playerid' has killed to end there ks
*/
switch(killstreak)
{
case 1: {} // KS 1
case 2: {} // KS 2
case 3: {} // KS 3
case 4: {} // KS 4
}
return 1;
}
Players can use this inside there GM without even the filterscript.