Please help with TextDraw. (another problem already..)
#1

Hey guys. My apologizes for bothering you again.
But I really want this to be fixed.
I want that you can see your kills and deaths in a TextDraw.

I tryed but failed. please help.
The way I have it

On top
pawn Код:
new Text:KillDeath[MAX_PLAYERS];
forward killtimer(playerid);
pawn Код:
public OnPlayerConnect(playerid)
{
new string[400];
SetTimerEx("KillTimer",1000,true,"");
format(string,sizeof(string),"Kills: %d   Deaths: %d",kills[playerid],deaths[playerid]);
KillDeath[playerid] = TextDrawCreate(250,250,string);
TextDrawShowForPlayer(playerid,KillDeath[playerid]);
logged[playerid] = 0;
return 1;
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{

SendDeathMessage(killerid,playerid,reason);
deaths[playerid] ++;
kills[killerid] ++;
return 1;
}
pawn Код:
public killtimer(playerid)
{
new string[400];
TextDrawSetString(KillDeath[playerid],string);
return 1;
}
Well that's it.

Kills and deaths keep saying 0.
In the scriptfiles it's okay. They are telling me that I have the good amount of kills and deaths.
It is just that the textdraw doesn't shows them

Please help.


Thanks In
Advance
Reply
#2

Here, try this... It's untested but should work, however you'll need to change a few things to fit your script.

Click Here
Reply
#3

With this line
SetTimerEx("UpdateBar",1000,1,"%s",i);
My server.exe won't start.
Because of the %s
Reply
#4

pawn Код:
SetTimerEx("UpdateBar", 1000, 1, "i", playerid);
Sorry, change it to this.
Reply
#5

Quote:
Originally Posted by Shadow™
Посмотреть сообщение
pawn Код:
SetTimerEx("UpdateBar", 1000, 1, "i", playerid);
Sorry, change it to this.
No errors and it starts up.
But when I come ingame it doesn't show me any tesxtdraw :O
Reply
#6

Did you press Spawn?... o.o

If so, then uhm...

Change GetMaxPlayers() to MAX_PLAYERS, and add this under include a_samp

pawn Код:
#undef MAX_PLAYERS
#define MAX_PLAYERS 200 // Change to your max players
Reply
#7

Are you updating the string on the textdraw?
Reply
#8

Alright, try this:

Click Here
Reply
#9

thats easy brother.. I can help you with that Script but tell me something.

you want make a textdraw showing you the Kills And Death that you have, right?
Now i tell you one thing.. When you Reconnect to the server it will be always in 0 kills and 0 Death because you don't have a Save Stats System or Something like that.

Tell me, Do you wanna do it like that??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)