27.06.2012, 21:19
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;
}
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.