SA-MP Forums Archive
Please help with TextDraw. (another problem already..) - 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: Please help with TextDraw. (another problem already..) (/showthread.php?tid=162963)



Please help with TextDraw. (another problem already..) - bartje01 - 25.07.2010

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


Re: Please help with TextDraw. (another problem already..) - Shadow™ - 25.07.2010

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

Click Here


Re: Please help with TextDraw. (another problem already..) - bartje01 - 25.07.2010

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


Re: Please help with TextDraw. (another problem already..) - Shadow™ - 25.07.2010

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


Re: Please help with TextDraw. (another problem already..) - bartje01 - 25.07.2010

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


Re: Please help with TextDraw. (another problem already..) - Shadow™ - 25.07.2010

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



Re: Please help with TextDraw. (another problem already..) - -Rebel Son- - 25.07.2010

Are you updating the string on the textdraw?


Re: Please help with TextDraw. (another problem already..) - Shadow™ - 25.07.2010

Alright, try this:

Click Here


Respuesta: Please help with TextDraw. (another problem already..) - Lesinorion - 09.04.2011

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??