Killstreaks
#1

anyone know how to make a killstreak like if a player gets 3 kills in a row without dieing they get 100% health
Reply
#2

Adjust this tutorial to suit your needs.

http://forum.sa-mp.com/showthread.ph...t=killingspree
Reply
#3

Or use mine:

https://sampforum.blast.hk/showthread.php?tid=257250

Shows an example killstreak (RC-XD)
Reply
#4

One question is there a way if that if a player gets a certain amount of kills they can use a /cmd for the killstreak?
Reply
#5

pawn Код:
new KillStreak[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason){
    #pragma unused reason
    KillStreak[playerid] = 0;
    if(killerid >= 0) KillStreak[killerid]++;
    if(KillStreak[killerid == 3) SetPlayerHealth(playerid, 100);
    return 1;
}
Reply
#6

tbh that last post did not help me at all :/
Reply
#7

pawn Код:
new KillStreak[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason){
    #pragma unused reason
    KillStreak[playerid] = 0;
    if(killerid >= 0) KillStreak[killerid]++;
    if(KillStreak[killerid] == 3) SetPlayerHealth(playerid, 100);
    return 1;
}
Reply
#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
#9

my killstreaks are working fine but i just have no clue how to do this well i probaly know how to start.

if someone reaches a certain amount of kills they are able to use a cmd once.

so say someone gets a 3 killstreak

a message will tell them you have been rewarded with a health boost for 3 kills without dieing use /heal3.

and they write that cmd only to be able to use it once since they got the 3 streak.
Reply
#10

Quote:
Originally Posted by K9-
Посмотреть сообщение
pawn Код:
new KillStreak[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason){
    #pragma unused reason
    KillStreak[playerid] = 0;
    if(killerid >= 0) KillStreak[killerid]++;
    if(KillStreak[killerid] == 3) SetPlayerHealth(playerid, 100);
    return 1;
}
Why are you repeating me :P ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)