#1

pawn Код:
CMD:stats(playerid, params[])
{
   new str[128], Name[MAX_PLAYER_NAME], Donator[3];
   if(PlayerInfo[playerid][pDonator] == 1) format(Donator, sizeof Donator, "Yes");
   if(PlayerInfo[playerid][pDonator] == 0) format(Donator, sizeof Donator, "No");
   GetPlayerName(playerid, Name, sizeof(Name));
   new Float:ratio = PlayerInfo[playerid][pKills]/PlayerInfo[playerid][pDeaths];
   format(str, sizeof str, "%s stats: Kills: %i Deaths: %i K/D Ratio: %i Admin Level: %i Donator: %s", Name,PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],ratio,PlayerInfo[playerid][pAdmin],Donator);
   SendClientMessage(playerid, COLOR_LIGHTRED, str);
  return 1;
}
Hi.
I made this code for my friend, for a server he is making. It shows no errors in Pawno, but ingame it says Unknown Command when you try to use it. Also, the K/D ratio doesnt seem to work, and I dont know why. I also tried with floatdiv, and that didnt make any difference.

What have I done wrong?
thanks,
-Aston.
Reply
#2

Are all his commands scripted using ZCMD, or are they a mixture of ZCMD and STRCMP?
Reply
#3

Replace
pawn Код:
Ratio: %i
With
pawn Код:
Ratio: %f
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)