#1

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. !
Reply
#2

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.
Reply
#3

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
Reply
#4

check the stored files login then die and kill someone then check if it saved
Reply
#5

Make a function that updates the textdraw with the same text Then the new numbers would be there
Reply
#6

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
Reply
#7

Instead of creating a new textdraw every time, just use TextDrawSetString.
Reply
#8

can you help a bit grim? I don't get whar you mean.
Reply
#9

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;
}
Reply
#10

Код:
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);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)