Killing Spree Help
#1

I wanna make a killing spree which always show the Current kiling spree at right bottom of screen ..
Which Show The Name OF Player And His Killing Spree.

eg;;
Player Is On Killing Spree Of 5 Kills in A row.

or if killing changes to 10
then it would be like this

Player Is On Killing Spree Of 10 Kills in A row.

And if killing spree end by another player it should show `Player's Killing Spree is ended by *Player1

` it is the player who is on killing spree
* and this is the player who ended killing spree

I have Made A Try To Make Such Type Of Script But It IS Having A lot Of Errors....

Check The Attachment ..


Please Help !!!
Reply
#2

This is how i would do it:

Top...

Код:
new KillingSpree[MAX_PLAYERS]
under OnPlayerDeath(playerid, killerid, reason)...

Код:
KillingSpree[killerid] ++;
KillingSpree[playerid] = 0;

if(KillingSpree[killerid] == 5)
{
//do this
}
else if(KillingSpree[killerid] ==10
{
//Do that
}

//And so on..
Reply
#3

Quote:
Originally Posted by Stigg
Посмотреть сообщение
This is how i would do it:

Top...

Код:
new KillingSpree[MAX_PLAYERS]
under OnPlayerDeath(playerid, killerid, reason)...

Код:
KillingSpree[killerid] ++;
KillingSpree[playerid] = 0;

if(KillingSpree[killerid] == 5)
{
//do this
}
else if(KillingSpree[killerid] ==10
{
//Do that
}

//And so on..
Hey But I want To add Text Draw
Reply
#4

Do you have any experiences with strings and textdraws?
Reply
#5

Quote:
Originally Posted by OldDirtyBastard
Посмотреть сообщение
Do you have any experiences with strings and textdraws?
Some I have Created Drift Point And Announcement Text Draws In The Game
Reply
#6

Try this:

pawn Код:
new KillingSpree[MAX_PLAYERS]
under OnPlayerDeath(playerid, killerid, reason)...

pawn Код:
KillingSpree[killerid] ++;
    KillingSpree[playerid] = 0;
    if(KillingSpree[killerid] == 5)
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(killerid,name,sizeof(name));
        new streaktxt[128];
        format(streaktxt,sizeof(streaktxt),"~b~NEWS FLASH:~w~ %s is on a Killing Spree. Kills: %d",name,KillingSpree[killerid]);
        TextDrawSetString(YOUR_TEXTDRAW,streaktxt);
    }
    else if(KillingSpree[killerid] == 10)
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(killerid,name,sizeof(name));
        new streaktxt[128];
        format(streaktxt,sizeof(streaktxt),"~b~NEWS FLASH:~w~ %s is on a Killing Spree. Kills: %d",name,KillingSpree[killerid]);
        TextDrawSetString(YOUR_TEXTDRAW,streaktxt);
    }

    And so on...
Reply
#7

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Try this:

pawn Код:
new KillingSpree[MAX_PLAYERS]
under OnPlayerDeath(playerid, killerid, reason)...

pawn Код:
KillingSpree[killerid] ++;
    KillingSpree[playerid] = 0;
    if(KillingSpree[killerid] == 5)
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(killerid,name,sizeof(name));
        new streaktxt[128];
        format(streaktxt,sizeof(streaktxt),"~b~NEWS FLASH:~w~ %s is on a Killing Spree. Kills: %d",name,KillingSpree[killerid]);
        TextDrawSetString(YOUR_TEXTDRAW,streaktxt);
    }
    else if(KillingSpree[killerid] == 10)
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(killerid,name,sizeof(name));
        new streaktxt[128];
        format(streaktxt,sizeof(streaktxt),"~b~NEWS FLASH:~w~ %s is on a Killing Spree. Kills: %d",name,KillingSpree[killerid]);
        TextDrawSetString(YOUR_TEXTDRAW,streaktxt);
    }

    And so on...
Getting error
..
newkillingS.pwn(64) : error 035: argument type mismatch (argument 1)
Reply
#8

And line 64 ?
Reply
#9

Quote:
Originally Posted by Stigg
Посмотреть сообщение
This is how i would do it:

Top...

Код:
new KillingSpree[MAX_PLAYERS]
under OnPlayerDeath(playerid, killerid, reason)...

Код:
KillingSpree[killerid] ++;
KillingSpree[playerid] = 0;

if(KillingSpree[killerid] == 5)
{
//do this
}
else if(KillingSpree[killerid] ==10
{
//Do that
}

//And so on..
i never understood something.... can you plz explain to me what the ++ do? i mean... why this line important and what it do?
pawn Код:
KillingSpree[killerid] ++;
Reply
#10

Quote:
Originally Posted by omer5198
Посмотреть сообщение
i never understood something.... can you plz explain to me what the ++ do? i mean... why this line important and what it do?
pawn Код:
KillingSpree[killerid] ++;
pawn Код:
KillingSpree[killerid] ++;
adds 1 to the variable.

pawn Код:
KillingSpree[killerid] += 1;
And

pawn Код:
KillingSpree[killerid] = KillingSpree[killerid] +1;
Would be the same

As:

pawn Код:
KillingSpree[killerid] ++;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)