Format Problem
#3

Okay since the above poster didn't explain the problem...(and didn't fix the other problems)

The problem is that you're trying to use an array in format called "string", but that array does not exist, so you need to make one. There's also no need to create another variable just to get a value from another variable, additionally you're using %s for strings and I assume this is an integer so you need to use %i.

Here's an example:

pawn Код:
if(strcmp(cmd, "/mats", true) == 0)
{
    new string[8];
    SendClientMessage(playerid, COLOR_WHITE, "Amount of Materials....");
    format(string,sizeof(string),"%d", PlayerInfo[playerid][pMats]);
    SendClientMessage(playerid, COLOR_WHITE, string);
    return 1;
}
That's all you need, although why not juse have the "Amount of Materials: %d" in the format, instead of having them as separate messages on separate lines
Reply


Messages In This Thread
Format Problem - by Grant Johnston - 09.09.2011, 12:08
Re: Format Problem - by Bumbis - 09.09.2011, 12:09
Re: Format Problem - by JaTochNietDan - 09.09.2011, 12:14
Re: Format Problem - by iJumbo - 09.09.2011, 12:14
Re: Format Problem - by Grant Johnston - 09.09.2011, 13:15

Forum Jump:


Users browsing this thread: 2 Guest(s)