How need make "End Killstreak" -
Groc - 23.03.2017
Hi
How need make if player reach for example 4ks and more, i kill him message send "Player Blalbla ended Bsdfsd killstreak" and achieve same exp how many ks he did for example 4ks = 4exp 5ks = 5exp 6ks = 6exp and etc
Re: How need make "End Killstreak" -
ISmokezU - 23.03.2017
uhh...
What's your code like?
Re: How need make "End Killstreak" -
Groc - 23.03.2017
Код:
new kstring[256];
switch(pInfo[killerid][Killstreak])
{
case 5: format(kstring,sizeof(kstring),""chat""COL_GREEN" %s has achieved a 5 killstreak "COL_WHITE"(+5 XP)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 5;
Re: How need make "End Killstreak" -
Groc - 23.03.2017
Bump
Re: How need make "End Killstreak" -
Hunud - 23.03.2017
Just send a message (killerid) has killed (playerid) and ended his kill strike of bla bla. got it ?
Re: How need make "End Killstreak" -
Groc - 23.03.2017
Quote:
Originally Posted by Hunud
Just send a message (killerid) has killed (playerid) and ended his kill strike of bla bla. got it ?
|
Well its not so easy as it look. First how need check are player in killstreak because if i kill player without kills it will send message, so it shit dude.
Re: How need make "End Killstreak" -
Hunud - 23.03.2017
Example like this! You just need to set your variables
if(pInfo[killerid][Killstreak])
{
format(text, sizeof(text), "%s killing spree has been ended by %s", PlayerName1(playerid) PlayerName2(killerid));
SendClientMessageToAll(playerid, text);
}
Re: How need make "End Killstreak" -
Groc - 23.03.2017
Quote:
Originally Posted by Hunud
Example like this! You just need to set your variables
if(pInfo[killerid][Killstreak])
{
format(text, sizeof(text), "%s killing spree has been ended by %s", PlayerName1(playerid) PlayerName2(killerid));
SendClientMessageToAll(playerid, text);
}
|
So how should i put those variable if there are just case?
Код:
new kstring[256];
switch(pInfo[killerid][Killstreak])
{
case 5: format(kstring,sizeof(kstring),""chat""COL_GREEN" %s has achieved a 5 killstreak "COL_WHITE"(+5 XP)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 5;
case 10: format(kstring,sizeof(kstring),""chat""COL_GREEN" %s has achieved a 10 killstreak "COL_WHITE"(+10 XP)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 10;
So the important part how need get player kills and give the same exp if you kill him like example he made 4kills, i kill him i get 4exp ant etc so if he do <4 lower then 4ks this "End Killstreak" doesnt show up.
Re: How need make "End Killstreak" -
Vince - 23.03.2017
Honestly, it's just a simple if-statement.
Код:
If player-who-died has killstreak greater than or equal to 5 then send message: player-who-died's killstreak was ended by player-who-killed.
Код:
if(pInfo[playerid][Killstreak] >= 5)
{
printf("%d has ended the killstreak of %d", killerid, playerid);
}
Re: How need make "End Killstreak" -
Groc - 23.03.2017
Quote:
Originally Posted by Vince
Honestly, it's just a simple if-statement.
Код:
If player-who-died has killstreak greater than or equal to 5 then send message: player-who-died's killstreak was ended by player-who-killed.
Код:
if(pInfo[playerid][Killstreak] >= 5)
{
printf("%d has ended the killstreak of %d", killerid, playerid);
}
|
Bat is there no easer way? because i have max 120ks so i need make each different checking? Because i want make not like this 5,10,15,20,etc i want make 5,6,7,8,9,10,etc so if i make it with different checking it will take thousands of lines