problem with something
#1

Hi,

I have made a killstreak system.

Heres only one example:
pawn Код:
if(Killspree[killerid] == 3)
    {
       GetPlayerName(killerid,playername,sizeof(playername));
       format(string,sizeof(string),"%s[%d] Is now on a killing spree of 3!", playername,playerid);
       SendClientMessageToAll(COLOR_GREEN,string);
       PlayerHasKillingSpree[killerid] = true;

    }
I also have made this:

pawn Код:
if(PlayerHasKillingSpree[playerid] == true)
    {
        SendClientMessage(playerid,COLOR_GREEN,"You died your killing spree ended.");
        GameTextForPlayer(playerid,"~W~You died~N~~R~Killing spree ended",3000,6);

    }
It checks if the player had a killing spree when he died and if so it will show that message but theres a problem. The message doesn't show to anyone , not even the dead player.

Any help is appreciated thanks.
Reply
#2

When player kills someone, does it add? I meant.
pawn Код:
VARIABLE[playerid]++;
Also, in which callbacks did you put these two codes? give me more effort to help you.
Reply
#3

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
When player kills someone, does it add? I meant.
pawn Код:
VARIABLE[playerid]++;
Also, in which callbacks did you put these two codes? give me more effort to help you.
Under OnPlayerdeath and yes it does count.

pawn Код:
Killspree[killerid]++;
    Killspree[playerid]=0;
Reply
#4

You put both of them under OnPlayerDeath? if so, that's dumb, because no matter what... the variable will return to 0. If not, then tell me where the Killspree[playerid] = 0; is standing.
Reply
#5

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
You put both of them under OnPlayerDeath? if so, that's dumb, because no matter what... the variable will return to 0. If not, then tell me where the Killspree[playerid] = 0; is standing.
It is under OnPlayerDeath.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new playerscore;
    new string[128];
    new playername[MAX_PLAYER_NAME];
    Killspree[killerid]++;
    Killspree[playerid]=0;
If that helps some more.
And yes, it may be dumb but I am dumb in this matter. so if you could help out it's all apreciated.
Thanks.
Reply
#6

Don't call yourself a dumb, programing isn't easy, if it was then everybody was smart and no plugins and filterscript or anything else would have released. I can help you but I ask last time, give me the full OnPlayerDeath and anything that (FULL) related to Killstreak then I'll help you, promising.
Reply
#7

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
Don't call yourself a dumb, programing isn't easy, if it was then everybody was smart and no plugins and filterscript or anything else would have released. I can help you but I ask last time, give me the full OnPlayerDeath and anything that (FULL) related to Killstreak then I'll help you, promising.
Yes, I am finding it very hard. But I would prefere if I didn't post this code to the public. Can I pm you ?
Reply
#8

pawn Код:
if(PlayerHasKillingSpree[playerid] >= 1)
{
    SendClientMessage(playerid,COLOR_GREEN,"You died your killing spree ended.");
    GameTextForPlayer(playerid,"~W~You died~N~~R~Killing spree ended",3000,6);
}
No need to show your whole codes, just the things which are needed.
Reply
#9

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
pawn Код:
if(PlayerHasKillingSpree[playerid] >= 1)
{
    SendClientMessage(playerid,COLOR_GREEN,"You died your killing spree ended.");
    GameTextForPlayer(playerid,"~W~You died~N~~R~Killing spree ended",3000,6);
}
No need to show your whole codes, just the things which are needed.
I used a bool , so this wouldn't work. But thanks.
pawn Код:
new bool:PlayerHasKillingSpree[MAX_PLAYERS];
Reply
#10

Quote:
Originally Posted by Jay.
Посмотреть сообщение
Yes, I am finding it very hard. But I would prefere if I didn't post this code to the public. Can I pm you ?
Yes, of course you can.
Quote:
Originally Posted by Wesley221
Посмотреть сообщение
pawn Код:
if(PlayerHasKillingSpree[playerid] >= 1)
{
    SendClientMessage(playerid,COLOR_GREEN,"You died your killing spree ended.");
    GameTextForPlayer(playerid,"~W~You died~N~~R~Killing spree ended",3000,6);
}
No need to show your whole codes, just the things which are needed.
It might be the solution, but he doesn't need to put >= on‌ly ==, I guess there isn't differences but it's better this way.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)