09.07.2011, 22:53
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:
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?:
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
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(playerid, 0x33CCFFAA); // Blue
SetPlayerTeam(playerid, 1); // I've do that for making player in the team 1
}
case 1:
{
SetPlayerColor(playerid, 0xFF0000AA); // Red
SetPlayerTeam(playerid, 2); // I've do that for making player in the team 2
}
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
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;
}
Can I make something like this?:
PHP код:
public OnPlayerConnect(playerid)
{
new newtext[41];
GetPlayerScore(playerid, team1score);
format(newtext, sizeof(newtext), "BLUE: %d", team1score);
TextDrawSetString(textdrawblue, newtext);
TextDrawShowForPlayer(playerid, textdrawblue);
return 1;
}
Thank's for your help, and sorry for my english, but I'm not English