TextDraw
#4

something like that

pawn Код:
new Text:score[MAX_PLAYERS];//define var for textdraw (MAX_PLAYERS)

public OnGameModeInit()
{
    SetTimer("MyFunction",2000,true);//creates the timer
    /*Creates the textdraw for every player*/
    for(new i = 0; i != MAX_PLAYERS; i++) {//loop trough all players (i = playerid)
        score[i] = TextDrawCreate(545.0, 35.0, "_");
        TextDrawLetterSize(score[i] , 0.2, 1.0);
        TextDrawColor(score[i] , 0x800080FF);
        TextDrawSetShadow(score[i] , 2);
        TextDrawSetOutline(score[i] , true);
    }
    return 1;
}

forward MyFunction();//forward the function
public MyFunction()//the function (MyFunction)
{
    new text[41];//variable store the text
    for(new i = 0; i != MAX_PLAYERS; i++) {//loop trough all players (i = playerid)
        if(IsPlayerConnected(i)) { //player is connected ok then do something
            format(text, sizeof(text), "Score: %d",pScore[i]);
            TextDrawSetString(score[i], text);
            TextDrawShowForPlayer(i,score[i]);
        }
    }
}
Reply


Messages In This Thread
TextDraw - by lsreskjn - 07.08.2013, 13:23
Re: TextDraw - by iJumbo - 07.08.2013, 13:26
Re: TextDraw - by lsreskjn - 07.08.2013, 13:31
Re: TextDraw - by iJumbo - 07.08.2013, 13:42
Re: TextDraw - by lsreskjn - 07.08.2013, 13:59
Re: TextDraw - by iJumbo - 07.08.2013, 14:02

Forum Jump:


Users browsing this thread: 1 Guest(s)