why? - 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: why? (
/showthread.php?tid=162768)
why? -
bartje01 - 24.07.2010
Hey guys. WHy don't my kills and deaths shows in my textdraw.
it keep saying 0. also when I die.
pawn Код:
format(string,sizeof(string),"Kills: %d Deaths: %d",kills[playerid],deaths[playerid]);
kcount = TextDrawCreate(366,333,string);
Please help. !
Re: why? -
TTJJ - 24.07.2010
Hi there,
Are you sure you are increasing the deaths and kills when a player dies?
Код:
//OnPLayerDeath
deaths[playerid] ++;
kills[killerid] ++;
Give it a try,
Cheers.
Re: why? -
bartje01 - 24.07.2010
Yup it's there
I have the
pawn Код:
format(string,sizeof(string),"Kills: %d Deaths: %d",kills[playerid],deaths[playerid]);
kcount = TextDrawCreate(366,333,string);
At my /login command
Re: why? -
Kar - 24.07.2010
check the stored files login then die and kill someone then check if it saved
Re: why? -
Fj0rtizFredde - 24.07.2010
Make a function that updates the textdraw with the same text
Then the new numbers would be there
Re: why? -
bartje01 - 24.07.2010
Hmm.
I have this at onplayerdeath
kills[killerid] =1;
deaths[playerid] =1;
But when I die and look in my scriptfiles deaths still say 0
Re: why? -
Grim_ - 24.07.2010
Instead of creating a new textdraw every time, just use TextDrawSetString.
Re: why? -
bartje01 - 24.07.2010
can you help a bit grim? I don't get whar you mean.
Re: why? -
Grim_ - 24.07.2010
I'm assuming you re-create the textdraw on OnPlayerDeath? Then just do:
pawn Код:
OnPlayerConnect(playerid)
{
//Create the textdraw
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
format(string,sizeof(string),"Kills: %d Deaths: %d",kills[playerid],deaths[playerid]);
TextDrawSetString(kcount[playerid], string);
return 1;
}
Re: why? -
bartje01 - 24.07.2010
Код:
C:\Users\Bart\Desktop\bart en roy server\gamemodes\Deathmatch.pwn(427) : error 028: invalid subscript (not an array or too many subscripts): "kcount"
C:\Users\Bart\Desktop\bart en roy server\gamemodes\Deathmatch.pwn(427) : warning 215: expression has no effect
C:\Users\Bart\Desktop\bart en roy server\gamemodes\Deathmatch.pwn(427) : error 001: expected token: ";", but found "]"
C:\Users\Bart\Desktop\bart en roy server\gamemodes\Deathmatch.pwn(427) : error 029: invalid expression, assumed zero
C:\Users\Bart\Desktop\bart en roy server\gamemodes\Deathmatch.pwn(427) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Error line
TextDrawSetString(kcount[playerid], string);