Killing Spree problem[Most simple and I have problem :( ]
#1

Hello everybody.I make killing spree but textdraw which i add wont show i dont know why.Before I add one variable killing Spree is not working...Please help
code:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new str[144];
    KillingSpree[playerid] = 0;
    if(KillingSpree[killerid] == 3) // It finds if the player is on a Killing Spree of 3 kills , you may change
    {
        new yName[MAX_PLAYER_NAME];
        GetPlayerName(killerid,yName,sizeof(yName));
        format(str,sizeof(str),"%s is on a killing spree (3 kills)",yName);
        TextDrawSetString(KillS,str);
        TextDrawShowForAll(KillS);
        SetTimer("HideText",5000,0);
        pStreak[killerid]++,SendClientMessage(killerid,white,""embed_yellow"[KILLSTREAK]"embed_white"You reached RPG in your killstreak"embed_blue"(/killstreak)"embed_white"!");
    }
    if(KillingSpree[killerid] == 6) // It finds if the player is on a Killing Spree of 3 kills , you may change
    {
        new yName[MAX_PLAYER_NAME];
        GetPlayerName(killerid,yName,sizeof(yName));
        format(str,sizeof(str),"%s is on a killing spree (6 kills)",yName);
        TextDrawSetString(KillS,str);
        TextDrawShowForAll(KillS);
        SetTimer("HideText",5000,0);
        pStreak[killerid]++;
     }
    if(KillingSpree[killerid] == 9) // It finds if the player is on a Killing Spree of 3 kills , you may change
    {
        new yName[MAX_PLAYER_NAME];
        GetPlayerName(killerid,yName,sizeof(yName));
        format(str,sizeof(str),"%s is on a killing spree (9 kills)",yName);
        TextDrawSetString(KillS,str);
        TextDrawShowForAll(KillS);
        SetTimer("HideText",5000,0);
        pStreak[killerid]++;
     }
    if(KillingSpree[killerid] == 12) // It finds if the player is on a Killing Spree of 3 kills , you may change
    {
        new yName[MAX_PLAYER_NAME];
        GetPlayerName(killerid,yName,sizeof(yName));
        format(str,sizeof(str),"%s is on a killing spree (12 kills)",yName);
        TextDrawSetString(KillS,str);
        TextDrawShowForAll(KillS);
        SetTimer("HideText",5000,0);
        pStreak[killerid]++;
     }
    if(KillingSpree[killerid] == 16) // It finds if the player is on a Killing Spree of 3 kills , you may change
    {
        new yName[MAX_PLAYER_NAME];
        GetPlayerName(killerid,yName,sizeof(yName));
        format(str,sizeof(str),"%s is on a killing spree (16 kills)",yName);
        TextDrawSetString(KillS,str);
        TextDrawShowForAll(KillS);
        SetTimer("HideText",5000,0);
        pStreak[killerid]++;
     }
    if(KillingSpree[killerid] == 18) // It finds if the player is on a Killing Spree of 3 kills , you may change
    {
        new yName[MAX_PLAYER_NAME];
        GetPlayerName(killerid,yName,sizeof(yName));
        format(str,sizeof(str),"%s is on a killing spree (18 kills)",yName);
        TextDrawSetString(KillS,str);
        TextDrawShowForAll(KillS);
        SetTimer("HideText",5000,0);
        pStreak[killerid]++;
    }
    return 1;
}
Reply
#2

Why you have added "TextDrawShowForAll" ? you have to show it only to player not to everybody..
Reply
#3

Btw, add this under onplayerdeath

pawn Код:
new pname[24],string[128];
    GetPlayerName(killerid, pname, sizeof(pname));
    KillingSpree[killerid] ++;
    KillingSpree[playerid] = 0;
and remove your one..
Reply
#4

I give that TextdrawShowForAll to everybody see who is on killing spree...So i need to fix problem with textdraw...
Reply
#5

can you show the Textdraw(s) which is under OnGamemodeInIt?
Reply
#6

Look When player kill 3 other players nothing will show...I dont know what is problem..Textdraws wont work variables too...I dont know whats problem everything seems fine..
Reply
#7

There need to be a textdraw before showing it e.g have you made something like this? show it
pawn Код:
TextDrawShowForAll(Textdraw0);
    TextDrawShowForAll(Textdraw1);
    Textdraw0 = TextDrawCreate(45.000000,428.000000,"Under Devolopment,Beta v0.2");
    Textdraw1 = TextDrawCreate(460.000000,7.000000,"www.AddYourForums.com");
    TextDrawAlignment(Textdraw0,0);
    TextDrawAlignment(Textdraw1,0);
    TextDrawBackgroundColor(Textdraw0,0x000000ff);
    TextDrawBackgroundColor(Textdraw1,0x000000ff);
    TextDrawFont(Textdraw0,3);
    TextDrawLetterSize(Textdraw0,1.100000,2.200000);
    TextDrawFont(Textdraw1,3);
    TextDrawLetterSize(Textdraw1,0.399999,1.700000);
    TextDrawColor(Textdraw0,0xff0000cc);
    TextDrawColor(Textdraw1,0xffffffff);
    TextDrawSetOutline(Textdraw0,1);
    TextDrawSetOutline(Textdraw1,1);
    TextDrawSetProportional(Textdraw0,1);
    TextDrawSetProportional(Textdraw1,1);
    TextDrawSetShadow(Textdraw0,1);
    TextDrawSetShadow(Textdraw1,1);
Reply
#8

SpiderWalk. Ill fix it for you. Just do me a favor. Paste your whole public OnGameModeInIt(); Callback from your game mode.
Reply
#9

i told him but he won't show,..
Reply
#10

First thing you need to do is add
KillingSpree[killerid] ++;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)