SA-MP Forums Archive
Killstreaks - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Killstreaks (/showthread.php?tid=260218)



Killstreaks - muhib777 - 07.06.2011

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


Re: Killstreaks - Stigg - 07.06.2011

Adjust this tutorial to suit your needs.

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


Re: Killstreaks - Snipa - 07.06.2011

Or use mine:

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

Shows an example killstreak (RC-XD)


Re: Killstreaks - muhib777 - 07.06.2011

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?


Re: Killstreaks - StilThere - 07.06.2011

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;
}



Re: Killstreaks - muhib777 - 07.06.2011

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


Respuesta: Killstreaks - K9- - 07.06.2011

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;
}



Re: Killstreaks - iFriSki - 08.06.2011

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
}



Re: Killstreaks - muhib777 - 08.06.2011

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.


Re: Respuesta: Killstreaks - StilThere - 08.06.2011

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 ?