SA-MP Forums Archive
[HELP] Little help +REP1 !!! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] Little help +REP1 !!! (/showthread.php?tid=482434)



[HELP] Little help +REP1 !!! - VenomMancer - 21.12.2013

I make thsi commands :

PHP код:
CMD:stats(playerid,params[]) {
    new 
string[128], pDeathsplayer1hms;
    if(
isnull(params)) player1 playerid;
    else 
player1 strval(params);
    if(
IsPlayerConnected(player1)) {
        
TotalGameTime(player1hms);
         if(
PlayerInfo[player1][Deaths] == 0pDeaths 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"hms);
        
ShowPlayerDialog(playerid,9800,DIALOG_STYLE_MSGBOX,"{00FF00}Player stats",wlcm,"Ok","");
    } else return 
SendClientMessage(playeridred"Player Not Connected!");

Then i got this :

Quote:

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

Please help me ;)
for +REP1 !!


Re: [HELP] Little help +REP1 !!! - SilentSoul - 21.12.2013

@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 Код:
format(string,sizeof(string),"Kills :%s \nDeaths : %s",PlayerInfo[player1][Kills],PlayerInfo[player1][Deaths]);



Re: [HELP] Little help +REP1 !!! - VenomMancer - 21.12.2013

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
@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 Код:
format(string,sizeof(string),"Kills :%s \nDeaths : %s",PlayerInfo[player1][Kills],PlayerInfo[player1][Deaths]);
Can you make for me, with dialog_message ?


Re: [HELP] Little help +REP1 !!! - SilentSoul - 21.12.2013

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;
}



Re: [HELP] Little help +REP1 !!! - VenomMancer - 22.12.2013

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
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;
}

WORKED !!!

Thanks +REP1 !