SA-MP Forums Archive
Texdraw - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Texdraw (/showthread.php?tid=111709)



Texdraw - jaksimaksi - 03.12.2009

Hi, i'm thinking how to create texdraw like this:
[img width=1024 height=151]/imageshack/img252/7423/asasf.png[/img]
This texdraw can change title Home and Guest with command /team name 1, /team name 0
And team's scores with command - /team score 1, /team score 0
Can someone can show my how to do such a texdraw? i've be verry happy. thanks.


Re: Texdraw - member - 03.12.2009

Rather than using a command to change the score of each team, i'd recommend using a timer, it should save you time having to change team's score manually. I can make you a command to change the team names using a command, but i need to know what command processing method you use. (e.g. strcmp, dcmd, zcmd etc and whether you use sscanf).

pawn Код:
#define MAX_SERVER_PLAYERS 50 //change to the max player slots in your server
#define TEAM_HOME 0
#define TEAM_AWAY 1
#define INGAME 0
#define OUTGAME 1

new TeamName[2][64] = {{"Home"}, {"Away"}}; //change the default team names here
new TeamPlayers[2][2]; //TeamPlayers[TeamID][ingame/outgame]
new TeamScore[2];//TeamScore[TEAMID][Score]
new RoundID;
new ModeTimer;


forward ModeUpdate();
public ModeUpdate()
{
    for(new i = 0; i < MAX_SERVER_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new string[256];
            format(string,sizeof(string),"~g~Round: %s ~y~Home * ~h~~h~ Players: ~w~%d ~y~~h~~h~/ ~w~%d Life: ~w~%d ~y~~h~~h~/ ~w~%d ~r~Guest * ~h~~h~ Players: ~w~%d ~r~~h~~h~/ ~w~%d Life: ~w~%d ~r~Score: ~w~%d", RoundID, TeamName[TEAM_HOME], TeamPlayers[TEAM_HOME][INGAME], TeamPlayers[TEAM_HOME][OUTGAME], TeamScore[TEAM_HOME], TeamName[TEAM_AWAY], TeamPlayers[TEAM_AWAY][INGAME], TeamPlayers[TEAM_AWAY][OUTGAME], TeamScore[TEAM_HOME]);
            TextDrawSetString(TEXTDRAWNAME,string); //CHANGE TEXTDRAW NAME WITH YOUR CREATED TEXTDRAW
        }
    }
    ModeTimer = SetTimer("ModeUpdate",1000,0);
}

//To Stop textdraw updating use: KillTimer(ModeTimer);
//change the value of RoundID for each round or whatever
Untested, there may be some mistakes. If so, post errors, or anyone can correct.
EDIT: it would help if you gave the variable to identify whether the player is in a round(alive) and not alive, how you identify teams etc to be in the timer.


Re: Texdraw - jaksimaksi - 03.12.2009

i'm using strcmp cmdtext.
[img width=1024 height=32]/imageshack/img408/9066/asssc.png[/img]

This texdraw shows not correctly..