Need help please..
#1

Код:
Stats()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
new temp[256];
format(temp,sizeof(temp),"%s Kills: %d Deaths: %d Ratio: %0.2f\r\n Teamkills: %d",name,PlayerData[i][Kills],
PlayerData[i][Deaths],ratio,PlayerData[i][Tkills]);
SendClientMessageToAll(COLOR_RED,temp);
TextDrawSetString(Text:DikkeDraw,temp);
TextDrawShowForAll(Text:DikkeDraw);
}
}
}
Kay, well my problem is that if there are 2players in the server the sendclientmessage works good, it shows an apart message for every player and his stats. But the Text in the textdraw is only from one player.. and it doesn't show the 2nd one.. Hope u understand me.
Reply
#2

bump.. please someone?
Reply
#3

first of all,

dont do Text:Dikkedraw in functions
just use DikkeDraw :p

2nd use
pawn Код:
SendClientMessage(i,COLOR_RED,temp);
3rd of all use
pawn Код:
TextDrawSetString(DikkeDraw,temp);
4th of all use
pawn Код:
TextDrawShowForPlayer(i,DikkeDraw);
its a loop, why use ForAll's ..?
I dont really know if thats what you need, but i can't really understand your english

EDIT: You don't need this in a loop
Reply
#4

pawn Код:
Stats()
{
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            new temp[128]; // 128 is enough, since it's the max for SendClientMessageToAll
            format(temp,sizeof(temp),"%s Kills: %d Deaths: %d Ratio: %0.2f\r\n Teamkills: %d",name,PlayerData[i][Kills],
            PlayerData[i][Deaths],ratio,PlayerData[i][Tkills]);
            SendClientMessageToAll(COLOR_RED,temp);
            TextDrawSetString(DikkeDraw,temp);
            TextDrawShowForAll(DikkeDraw);
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)