CMD:stats(playerid,params[]) {
new string[128], pDeaths, player1, h, m, s;
if(isnull(params)) player1 = playerid;
else player1 = strval(params);
if(IsPlayerConnected(player1)) {
TotalGameTime(player1, h, m, s);
if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
new wlcm[1300];
strcat(wlcm, "{00FF00}Player : %s's Stats\n\n",PlayerName2(player1));
strcat(wlcm, "{00FF00}Level: %s\n\n",GetRankFromLevel(player1));
strcat(wlcm, "{00FF00}Kills: %d\n\n",PlayerInfo[player1][Kills]);
strcat(wlcm, "{00FF00}Deaths: %d\n\n",PlayerInfo[player1][Deaths]);
strcat(wlcm, "{00FF00}Ratio: %0.2f\n\n",Float:PlayerInfo[player1][Kills]/Float:pDeaths);
strcat(wlcm, "{00FF00}Money: $%d\n\n",GetPlayerCash(player1));
strcat(wlcm, "{00FF00}Bank: $%d\n\n",PlayerInfo[player1][bank]);
strcat(wlcm, "{00FF00}Time: %d jam %d menit %d \n\n", h, m, s);
ShowPlayerDialog(playerid,9800,DIALOG_STYLE_MSGBOX,"{00FF00}Player stats",wlcm,"Ok","");
} else return SendClientMessage(playerid, red, "Player Not Connected!");
}
D:\ANGGA\SA-MP VGx's DATA\gamemodes\RG_FR.pwn(13658) : error 035: argument type mismatch (argument 3) D:\ANGGA\SA-MP VGx's DATA\gamemodes\RG_FR.pwn(13659) : error 035: argument type mismatch (argument 3) D:\ANGGA\SA-MP VGx's DATA\gamemodes\RG_FR.pwn(13662) : warning 213: tag mismatch D:\ANGGA\SA-MP VGx's DATA\gamemodes\RG_FR.pwn(13665) : warning 202: number of arguments does not match definition D:\ANGGA\SA-MP VGx's DATA\gamemodes\RG_FR.pwn(13665) : warning 202: number of arguments does not match definition D:\ANGGA\SA-MP VGx's DATA\gamemodes\RG_FR.pwn(13650) : warning 204: symbol is assigned a value that is never used: "string" D:\ANGGA\SA-MP VGx's DATA\gamemodes\RG_FR.pwn(13650 -- 13668) : warning 209: function "cmd_stats" should return a value Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase |
format(string,sizeof(string),"Kills :%s \nDeaths : %s",PlayerInfo[player1][Kills],PlayerInfo[player1][Deaths]);
@Codes try to add return 1; at the ending because its missing , if you still got errors
Try to do them by formating a string instead of using strcat example : pawn Код:
|
CMD:stats(playerid,params[])
{
new string[128], pDeaths, player1, h, m, s;
if(isnull(params)) player1 = playerid;
else player1 = strval(params);
TotalGameTime(player1, h, m, s);
if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
new string[800];
format(string,sizeof(string),"Level : %s\n\nKills : %d\n\nDeaths : %d\n\nRatio : %0.2f\n\n{00FF00}Money: $%d\n\n{00FF00}Time: %d jam %d menit %d \n\n",GetRankFromLevel(playerid),PlayerInfo[playerid][Kills],PlayerInfo[playerid][Deaths],Float:PlayerInfo[playerid][Kills],Float:Float:pDeaths,GetPlayerMoney(playerid),h,m,s);
ShowPlayerDialog(playerid,9800,DIALOG_STYLE_MSGBOX,"{00FF00}Player stats",string,"Ok","");
return 1;
}
pawn Код:
|