Killstreaks
#8

Muhib, do you know how to work with arrays?

pawn Код:
new KillStreak[MAX_PLAYERS]; // Global variable 'KillStreak' the size of how many players your server holds

public OnPlayerDeath(playerid, killerid, reason)
{
//    #pragma unused reason // Not sure why you're doing this, as the reason can be useful elsewhere in this
    KillStreak[playerid] = 0; // If they die, they lose their KillStreak
    if(killerid >= 0) KillStreak[killerid]++; // If they didn't die, and killed someone, up it (Not sure as to what they had in mind with this condition..)
    if(KillStreak[killerid] >= 3) SetPlayerHealth(playerid, 100); // If their streak is >=3, give them 100 health
    return 1; // Lala
}
Reply


Messages In This Thread
Killstreaks - by muhib777 - 07.06.2011, 22:02
Re: Killstreaks - by Stigg - 07.06.2011, 22:04
Re: Killstreaks - by Snipa - 07.06.2011, 22:13
Re: Killstreaks - by muhib777 - 07.06.2011, 22:48
Re: Killstreaks - by StilThere - 07.06.2011, 22:50
Re: Killstreaks - by muhib777 - 07.06.2011, 23:40
Respuesta: Killstreaks - by K9- - 07.06.2011, 23:52
Re: Killstreaks - by iFriSki - 08.06.2011, 00:41
Re: Killstreaks - by muhib777 - 08.06.2011, 07:28
Re: Respuesta: Killstreaks - by StilThere - 08.06.2011, 10:42

Forum Jump:


Users browsing this thread: 1 Guest(s)