SA-MP Forums Archive
Killing Spree problem[Most simple and I have problem :( ] - 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)
+--- Thread: Killing Spree problem[Most simple and I have problem :( ] (/showthread.php?tid=337706)



Killing Spree problem[Most simple and I have problem :( ] - SpiderWalk - 27.04.2012

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



Re: Killing Spree problem[Most simple and I have problem :( ] - Rudy_ - 27.04.2012

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


Re: Killing Spree problem[Most simple and I have problem :( ] - Rudy_ - 27.04.2012

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..


Re: Killing Spree problem[Most simple and I have problem :( ] - SpiderWalk - 27.04.2012

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


Re: Killing Spree problem[Most simple and I have problem :( ] - Rudy_ - 27.04.2012

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


Re: Killing Spree problem[Most simple and I have problem :( ] - SpiderWalk - 27.04.2012

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..


Re: Killing Spree problem[Most simple and I have problem :( ] - Rudy_ - 27.04.2012

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



Re: Killing Spree problem[Most simple and I have problem :( ] - Ballu Miaa - 27.04.2012

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


Re: Killing Spree problem[Most simple and I have problem :( ] - Rudy_ - 27.04.2012

i told him but he won't show,..


Re: Killing Spree problem[Most simple and I have problem :( ] - Marco_Valentine - 27.04.2012

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