[HELP] string
#1

Hi, I was doing a command to display the status of the player, but have information that is not being shown, ie when I type / status everything appears normal at the Frag that does not appear.

script:

Код:
if (strcmp("/status", cmdtext, true) == 0)
	{
 new nick[MAX_PLAYER_NAME];
 new string1[256];
 GetPlayerName(playerid,nick,sizeof(nick));
 format(string1,sizeof(string1),"[Name: %s] [Kills: %d] [Deaths:%d] [Frag: %d]",nick,KILLS[playerid],DEATHS[playerid],KILLS[playerid]/DEATHS[playerid]);
 SendClientMessage(playerid,COLOR_GRAY,string1);
 return 1;
	}
Thank's
Reply
#2

Kills divided by deaths will not be an integer unless they happen to divide exactly, so using '%d' probably won't work. That is my guess anyway.

https://sampwiki.blast.hk/wiki/Format

Also you should check this out http://forum.sa-mp.com/index.php?topic=78026.0
Reply
#3

I found the solution !!!

Код:
if (strcmp("/status", cmdtext, true) == 0)
	{
 new nick[MAX_PLAYER_NAME];
 new string1[256];
 GetPlayerName(playerid,nick,sizeof(nick));
 format(string1,sizeof(string1),"[Nome: %s] [Matou Total: %d] [Morreu Total:%d] [Fragante Total: %.2f]",nick,MATOU[playerid],MORREU[playerid],float(MATOU[playerid])/float(MORREU[playerid]));
 SendClientMessage(playerid,COLOR_GRAY,string1);
 return 1;
	}
Reply
#4

Good, also: http://forum.sa-mp.com/index.php?topic=78026.0
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)