SA-MP Forums Archive
What's wrong? - 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: What's wrong? (/showthread.php?tid=304263)



What's wrong? - Face9000 - 17.12.2011

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.


Re: What's wrong? - kizla - 17.12.2011

on what line you get this error?


Re: What's wrong? - Face9000 - 17.12.2011

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



Re: What's wrong? - Berky - 17.12.2011

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'.


Re: What's wrong? - Face9000 - 17.12.2011

Oh right..thanks.


Re: What's wrong? - -Rebel Son- - 17.12.2011

You have to format the text in order to use Strings.


Re: What's wrong? - MaxSaint - 17.12.2011

Why do you use a DCMD? I suggest to use zCmd


Re: What's wrong? - -Rebel Son- - 17.12.2011

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.