01.01.2010, 05:17
I need a text draw to where, When a gang kills the opposit gangs gang membe, they're score goes up 1. and it just keeps going till the server restarts.
how can i do that?
how can i do that?
new team1score = 0;
new team2score = 0;
SetTimer("refreshsboard", 1000, true);
if(Team[killerid] == team1) // the killer is oart of team1
{
if(Team[playerid] == team2) // so if he kills a member of team2 then his score and his teams score gets increased.
{
team1score++;
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
}
}
if(Team[killerid] == team2)
{
if(Team[playerid] == team1)
{
team2score++;
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
}
}
forward refreshsboard();
public refreshsboard()
{
new score[128]; //reduced to 128 save some server memory
format(score, sizeof(score), "score ~n~ ~n~ ~n~ team1: %i ~n~ ~n~ team2: %i", team1score, team2score);
TextDrawSetString(scoretext, score);
for(new i = 0; i < MAX_SERVER_PLAYERS; i++) //change MAX_SERVER_PLAYERS to the maximum player slots you have on ur server
TextDrawShowForPlayer(playerid, scoretext)
return 1;
}