Using strcat but getting errors
#1

I know, I've been posting a lot lately, but I'm trying to be as precautions as possible.

pawn Код:
new
        string[800],
        string1[40];
    format(string1,sizeof(string1),"%s stats",GetName(clickedplayerid));

    strcat(string, "{CCFF00}%s{FFFFFF} currently has {33FF00}%d{FFFFFF} Kills and {FF0000}%d{FFFFFF} Deaths \nwhich averages to {FFFF66}%0.2f{FFFFFF} kills per every death. ", GetName(clickedplayerid),kills,deaths, Float:kills/Float:deaths);
    strcat(string, "\n{CCFF00}%s{FFFFFF} is {00FFCC}%s{FFFFFF} with a {00FFCC}%s{FFFFFF}\n%s currently has {33CC00}$%d{FFFFFF} in his pocket.", GetName(clickedplayerid),AdmRank,AccType,GetName(clickedplayerid), cash);
    strcat(string, "\n\tHe also has a total of {00CCFF}%d{FFFFFF} points\n\t%s\n\t%s\n\t%s\nHis internet connection is currently registered at %d ms ", score, Jailed, Muted, Caged, GetPlayerPing(clickedplayerid));
    ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, string1, string, "Close", ""); //Shows dialog with admins, one button "Close"
error 035: argument type mismatch (argument 3)
error 035: argument type mismatch (argument 3)
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
warning 204: symbol is assigned a value that is never used: "cash"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

Before making that. I tried this.

pawn Код:
string[800],
        string1[40];
    format(string1,sizeof(string1),"%s stats",GetName(clickedplayerid));
    format(string, 550, "{CCFF00}%s{FFFFFF} currently has {33FF00}%d{FFFFFF} Kills and {FF0000}%d{FFFFFF} Deaths \nwhich averages to {FFFF66}%0.2f{FFFFFF} kills per every death. ", GetName(clickedplayerid),kills,deaths, Float:kills/Float:deaths);
    format(string, 550, "\n{CCFF00}%s{FFFFFF} is {00FFCC}%s{FFFFFF} with a {00FFCC}%s{FFFFFF}\n%s currently has {33CC00}$%d{FFFFFF} in his pocket.", GetName(clickedplayerid),AdmRank,AccType,GetName(clickedplayerid), cash);
    format(string, 550, "\n\tHe also has a total of {00CCFF}%d{FFFFFF} points\n\t%s\n\t%s\n\t%s\nHis internet connection is currently registered at %d ms ", score, Jailed, Muted, Caged, GetPlayerPing(clickedplayerid));
    ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, string1, string, "Close", ""); //Shows dialog with admins, one button "Close"
However, even though it complied without error, I realised that this would only show the bottom part of the string, and ignore the 2 above.
Reply
#2

Can't seem to edit my OP for some reason.
This is the 2 snippet, that complied correctly but only show the bottom part of the string.
Reply
#3

Even i want to do something like this and can not do. Yeah people any suggestions for us?
to use strcat with the variables?
Reply
#4

I think strcat, unfortunately, only works when you split a string, from, let's say, /teleport, where you only need to split words inside a string, but when you include variables, I don't think it supports it.

Format() works, but will only show the last string issued, leaving all on top ignored and not used.
Reply
#5

Strcat() joins two strings together. But yes i dont think that it support's variables like format.

So what is the alternative for format()?
Reply
#6

I don't know. There may be a work around, but that's where the known scripters come in.
Reply
#7

Pretty unfortunate that there seems to be no work around, I guess the only solution is to reduce how I type.
Reply
#8

Quote:
Originally Posted by HydraX
Посмотреть сообщение
Pretty unfortunate that there seems to be no work around, I guess the only solution is to reduce how I type.
I tried doing that. In My script that doesnt help.

So yeah im still looking for someone who actually knows what to do here?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)