Killstreak TextDraw
#2

Try it:

I think you should add a Timer to update the textdraw:

PHP Code:
new Text:killstext;
public 
OnGameModeInit()
{
    
killstext TextDrawCreate(1.05.6" ");
    
TextDrawAlignment(killstext2);
    
TextDrawBackgroundColor(killstext255);
    
TextDrawFont(killstext3);
    
TextDrawLetterSize(killstext0.7099982.100001);
    
TextDrawColor(killstext, -1);
    
TextDrawSetOutline(killstext1);
    
TextDrawSetProportional(killstext0);
    return 
1;
}
stock HandleKS(playeridkillerid//put this function outside of any callbacks or functions
{
     
killstreak[playerid] = 0;
     
killstreak[killerid] ++;
     new 
msg1[64], msg2[64], name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], textdraw[41];
     
GetPlayerName(playeridname1strlen(name1));
     
GetPlayerName(playeridname2strlen(name2));
     
format(msg1strlen(msg1), "%s has ended %s's killstreak"name2name1);
     
format(msg2strlen(msg2), "%s is now on a killsreak of %i"name2killstreak[killerid]);
     
format(textdrawsizeof(textdraw), "%s: %i"namekillstreak[killerid]);
    
TextDrawSetString(killstextnewtext);
    
TextDrawShowForAll(killstext);
     
SendClientMessageToAll(COLOR_CYANmsg1);
     
SendClientMessageToAll(COLOR_CYANmsg2);
     switch(
killstreak[killerid])
     {
          case 
3:
          {
              new 
string[64], pName[MAX_PLAYER_NAME];
              
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
              
format(string,sizeof string,"%s is now on a Killstreak of 3 Kills.",pName);
              
SendClientMessageToAll(COLOR_CYAN,string);
          }
          case 
4:
          {
              new 
string[64], pName[MAX_PLAYER_NAME];
              
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
              
format(string,sizeof string,"%s is now on a Killstreak of 4 Kills.",pName);
              
SendClientMessageToAll(COLOR_CYAN,string);
          }
          case 
5:
          {
              new 
string[64], pName[MAX_PLAYER_NAME];
              
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
              
format(string,sizeof string,"%s is now on a Killstreak of 5 Kills.",pName);
              
SendClientMessageToAll(COLOR_CYAN,string);
          }
          case 
6:
          {
              new 
string[64], pName[MAX_PLAYER_NAME];
              
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
              
format(string,sizeof string,"%s is now on a Killstreak of 6 Kills.",pName);
              
SendClientMessageToAll(COLOR_CYAN,string);
          }
          case 
7:
          {
              new 
string[64], pName[MAX_PLAYER_NAME];
              
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
              
format(string,sizeof string,"%s is now on a Killstreak of 7 Kills.",pName);
              
SendClientMessageToAll(COLOR_CYAN,string);
          }
          case 
8:
          {
              new 
string[64], pName[MAX_PLAYER_NAME];
              
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
              
format(string,sizeof string,"%s is now on a Killstreak of 8 Kills.",pName);
              
SendClientMessageToAll(COLOR_CYAN,string);
          }
          case 
9:  //change the numbers as desired and add/remove as many as you want
          
{
              new 
string[64], pName[MAX_PLAYER_NAME];
              
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
              
format(string,sizeof string,"%s is now on a Killstreak of 9 Kills.",pName);
              
SendClientMessageToAll(COLOR_CYAN,string);
          }
     }
     return 
1;

Reply


Messages In This Thread
Killstreak TextDraw - by Avi Raj - 05.01.2013, 04:13
Re: Killstreak TextDraw - by ThePhenix - 05.01.2013, 04:42
Re: Killstreak TextDraw - by Avi Raj - 05.01.2013, 04:58
Re: Killstreak TextDraw - by ThePhenix - 05.01.2013, 05:09
Re: Killstreak TextDraw - by Avi Raj - 05.01.2013, 07:06

Forum Jump:


Users browsing this thread: 1 Guest(s)