What's wrong?
#1

Hello guys,i've created 4 variables to show server stats.

Kills/Deaths/Joins and Spawns.

I maked a cmd: /server - to show this stats,and i make in this way:

pawn Код:
dcmd_server(playerid, params[])
{
    SendClientMessage(playerid, COLOR_RED, "Server Stats.");
    SendClientMessage(playerid, COLOR_RED, "Note: The stats are GLOBALLY saved since the FIRST run of the server.");
    SendClientMessage(playerid, COLOR_GREEN, "Total Joins On Server: %s", TotalJoins);
    SendClientMessage(playerid, COLOR_GREEN, "Total Kills: %s", TotalKills);
    SendClientMessage(playerid, COLOR_GREEN, "Total Deaths: %s", TotalDeaths);
    SendClientMessage(playerid, COLOR_GREEN, "Total Spawns: %s", TotalSpawns);
    return 1;
    #pragma unused params
}
But i get this error:

warning 202: number of arguments does not match definition.

What's wrong?The TotalDeaths/Kills/Spawns/Joins are exactly setted and added.

Thanks.
Reply
#2

on what line you get this error?
Reply
#3

Quote:
Originally Posted by kizla
Посмотреть сообщение
on what line you get this error?
On lines with variables.

pawn Код:
SendClientMessage(playerid, COLOR_GREEN, "Total Joins On Server: %s", TotalJoins);
    SendClientMessage(playerid, COLOR_GREEN, "Total Kills: %s", TotalKills);
    SendClientMessage(playerid, COLOR_GREEN, "Total Deaths: %s", TotalDeaths);
    SendClientMessage(playerid, COLOR_GREEN, "Total Spawns: %s", TotalSpawns);
Reply
#4

You are using SendClientMessage as a format. You should first use 'format(string, sizeof(string), "input"); then use SendClientMessage(playerid, color, string);
Which would look like:
Код:
format(string, sizeof(string), "input");
SendClientMessage(playerid, color, string);
The output of the message would be 'input' sending it to the defined 'playerid'.
Reply
#5

Oh right..thanks.
Reply
#6

You have to format the text in order to use Strings.
Reply
#7

Why do you use a DCMD? I suggest to use zCmd
Reply
#8

DCMD is still used today by GF/Raven edits, And some small servers. There's nothing wrong with using it for smaller servers. but yeah , ZCMD is the way to go.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)