strcat
#1

pawn Код:
stock ShowStats(playerid)
{
    new string[1024], Float:hp, Float:x, Float:y, Float:z, Float:armour;
    GetPlayerHealth(playerid, hp);
    GetPlayerArmour(playerid, armour);
    GetPlayerPos(playerid, x, y, z);
    strcat(string, ""Green"===========================================================");
    strcat(string, ""Green"||\t\t"White"Your name: "Red"%s                                      "Green"||", GetName(playerid)); //740
    strcat(string, ""Green"||\t\t"White"Admin Level: "Red"%s                                    "Green"||", PlayerInfo[playerid][pAdminLevel]);
    strcat(string, ""Green"||\t\t"White"Level: "Red"%s                                          "Green"||", PlayerInfo[playerid][pLevel]);
    strcat(string, ""Green"||\t\t"White"Kills: "Red"%s                                          "Green"||", PlayerInfo[playerid][pKills]);
    strcat(string, ""Green"||\t\t"White"Deaths: "Red"%s                                         "Green"||", PlayerInfo[playerid][pDeaths]);
    strcat(string, ""Green"||\t\t"White"Times Kicked: "Red"%s                                   "Green"||", PlayerInfo[playerid][pKicked]);
    strcat(string, ""Green"||\t\t"White"Times Hacked: "Red"%s                                   "Green"||", PlayerInfo[playerid][pJailed]);
    strcat(string, ""Green"||\t\t"White"Jailed: "Red"%s                                         "Green"||", PlayerInfo[playerid][pJailed]);
    strcat(string, ""Green"||\t\t"White"Muted: "Red"%s                                          "Green"||", PlayerInfo[playerid][pMuted]);
    strcat(string, ""Green"||\t\t"White"Frozen: "Red"%s                                         "Green"||", PlayerInfo[playerid][pFrozen]);
    strcat(string, ""Green"||\t\t"White"Money: "Red"%s                                          "Green"||", GetPlayerCash(playerid));
    strcat(string, ""Green"||\t\t"White"Times on server: "Red"%s                                "Green"||", PlayerInfo[playerid][pServerTime]); //751
    strcat(string, ""Green"||\t\t"White"Health: "Red"%f.0                                       "Green"||", Float:hp); //752
    strcat(string, ""Green"||\t\t"White"Armour: "Red"%f                                         "Green"||", armour); //753
    strcat(string, ""Green"||\t\t"White"Possition: "Red"X: %f, Y: %f, Z: %f                     "Green"||", Float:x, Float:y, Float:z); //754
    strcat(string, ""Green"===========================================================");
    ShowPlayerDialog(playerid, Login, DIALOG_STYLE_MSGBOX, ""Red"Player Stats", string, "Okay", "Close");
}
pawn Код:
C:\Users\iMarkx\Documents\Server\gamemodes\FF.pwn(740) : error 035: argument type mismatch (argument 3)
C:\Users\iMarkx\Documents\Server\gamemodes\FF.pwn(752) : warning 213: tag mismatch
C:\Users\iMarkx\Documents\Server\gamemodes\FF.pwn(753) : warning 213: tag mismatch
C:\Users\iMarkx\Documents\Server\gamemodes\FF.pwn(754) : warning 213: tag mismatch
C:\Users\iMarkx\Documents\Server\gamemodes\FF.pwn(754) : warning 202: number of arguments does not match definition
C:\Users\iMarkx\Documents\Server\gamemodes\FF.pwn(754) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

strcat() was not made for formatting strings, format() was. You aren't using the correct arguments allocated to the function, furthermore you've tried to include tags in your variables (i.e: 'Float:y').

Simply use format(). strcat() was created for replicating the values of strings.
Reply
#3

Quote:
Originally Posted by Calg00ne
Посмотреть сообщение
strcat() was not made for formatting strings, format() was. You aren't using the correct arguments allocated to the function, furthermore you've tried to include tags in your variables (i.e: 'Float:y').

Simply use format(). strcat() was created for replicating the values of strings.
Okay, thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)