Help with TextDraw
#1

Hello guys, I need help to make a textdraw who will showing something like this : "RED: X - BLUE: Y"
I have read a lot of threads about this, but I can't understand all.. so I post here.

Here my code:


PHP код:
#define Teamblue 1
#define Teamred 2
new team1score;
new 
team2score;
public 
OnPlayerSpawn(playerid)
{
    
    switch(
pClass[playerid])
    {
        case 
0:
        {
            
            
SetPlayerColor(playerid0x33CCFFAA); // Blue
            
SetPlayerTeam(playerid1); // I've do that for making player in the team 1
        
}
        case 
1:
        {
            
            
SetPlayerColor(playerid0xFF0000AA); // Red
            
SetPlayerTeam(playerid2); // I've do that for making player in the team 2
        
}
    }
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
        if(
GetPlayerTeam(killerid) == 1)
            { 
                
team1score++; //Sets team1score
            
}
        if(
GetPlayerTeam(killerid) == 2)
            { 
                
team2score++; //Sets team2score
            
}
        if(
team1score == 100 || team2score == 100
            {
                
SendRconCommand("gmx"); //Restarts Server
            
}
        return 
1;

As can you see, the fonction who ad score to the team is here, but I really don't know what I need to do with textdraw, and I think I will need de timer, right?

Can I make something like this?:

PHP код:
public OnPlayerConnect(playerid)
{
    new 
newtext[41];
    
GetPlayerScore(playeridteam1score);
    
format(newtextsizeof(newtext), "BLUE: %d"team1score);
    
TextDrawSetString(textdrawbluenewtext);   
    
TextDrawShowForPlayer(playeridtextdrawblue);
    return 
1;

I didn't ask you to make it for me, but can you help me ? I really need this, I've done others things and this really stop me..

Thank's for your help, and sorry for my english, but I'm not English
Reply


Messages In This Thread
Help with TextDraw - by Sreadon - 09.07.2011, 22:53
Re: Help with TextDraw - by [HiC]TheKiller - 09.07.2011, 23:12
Re : Help with TextDraw - by Sreadon - 09.07.2011, 23:35

Forum Jump:


Users browsing this thread: 1 Guest(s)