Server stats when logging
#1

How to add server stats when player logs into server

My code witch got warnings in pawno
PHP код:
    new formatmin[4];
    if(
MPMinute 10format(formatmin,sizeof(formatmin),"0%d",MPMinute);
    else 
format(formatmin,sizeof(formatmin),"%d",MPMinute);
    
SendClientMessageExplayeridCOLOR_LAWNGREEN" " );
    
SendClientMessageExplayeridCOLOR_LAWNGREEN" " );
    
SendClientMessageExplayeridCOLOR_LAWNGREEN" " );
    
SendClientMessageExplayeridCOLOR_LAWNGREEN" " );
    
SendClientMessageExplayeridCOLOR_LAWNGREEN" " );
    
SendClientMessageExplayeridCOLOR_LIGHTBLUE"---------------------------------------------------" );
    
SendClientMessageExplayeridCOLOR_LIGHTBLUE"Welcome to City Life Roleplay (Version %s)",SERVER_GM_TEXT );
    
SendClientMessageExplayeridCOLOR_LIGHTBLUE"Homepage: www.citylife.eu5.org);
    
SendClientMessageExplayeridCOLOR_LIGHTBLUE"TeamSpeak: Comming soon" );
    
SendClientMessageExplayeridCOLOR_LIGHTBLUE"Registrations: %d Peak players recorded: %d (%d/%d/%d - %d:%s)",TotalRegister,MaxPlayersConnected,MPDay,MPMonth,MPYear,MPHour,formatmin);
    
SendClientMessageExplayeridCOLOR_LIGHTBLUE"Please wait for this gamemode to load... " );
    
SendClientMessageExplayeridCOLOR_LIGHTBLUE"---------------------------------------------------" ); 
Reply
#2

What are your warnings, and you should normally place this in
Код:
OnPlayerConnect(playerid);
Reply
#3

It is there

PHP код:
C:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(11092) : warning 202number of arguments does not match definition
C
:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(11095) : warning 202number of arguments does not match definition
C
:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(11095) : warning 202number of arguments does not match definition
C
:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(11095) : warning 202number of arguments does not match definition
C
:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(11095) : warning 202number of arguments does not match definition
C
:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(11095) : warning 202number of arguments does not match definition
C
:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(11095) : warning 202number of arguments does not match definition
C
:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(11095) : warning 202number of arguments does not match definition
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
8 Warnings

Reply
#4

I'd guess all of those warnings are from the SendClientMessageEx.
Please show your SendClientMessageEx.

Could appear:
pawn Код:
forward public SendClientMessageEx(...) {}
public SendClientMessageEx(...) {}
stock SendClientMessageEx(...) {}
function SendClientMessageEx(...) {}
#define SendClientMessageEx(...) \
One of those ^
Reply
#5

All other SendClientMessageEx is working.

I taked stats from this command
PHP код:
CMD:serverstats(playeridparams[])
{
    new 
string[128];

    new 
formatmin[4];
    if(
MPMinute 10format(formatmin,sizeof(formatmin),"0%d",MPMinute);
    else 
format(formatmin,sizeof(formatmin),"%d",MPMinute);
    
format(string,sizeof(string),"Server Statistics - Version %s (recorded since the 8th of November, 2011).",SERVER_GM_TEXT);
    
SendClientMessageEx(playeridCOLOR_WHITEstring);
    
format(stringsizeof(string), "* Objects: %d | Pickups: %d | Map icons: %d | 3D text labels: %d | TextDraws: %d | Loaded houses: %d",CountDynamicObjects(),CountDynamicPickups(),CountDynamicMapIcons(),CountDynamic3DTextLabels(),textdrawscount,MAX_HOUSES);
    
SendClientMessageEx(playeridCOLOR_GREYstring);
    
format(stringsizeof(string), "* Logins: %d | Connections: %d | Registrations: %d | Hackers autobanned: %d | Uptime: %d hours",TotalLoginTotalConnectTotalRegisterTotalAutoBanTotalUptime);
    
SendClientMessageEx(playeridCOLOR_GREYstring);
    
format(stringsizeof(string), "* Players connected: %d | Peak players recorded: %d (%d/%d/%d - %d:%s) | Player vehicles loaded: %d",PlayersConnected,MaxPlayersConnected,MPDay,MPMonth,MPYear,MPHour,formatmin,PlayerCars);
    
SendClientMessageEx(playeridCOLOR_GREYstring);
    return 
1;

And put them in here
PHP код:
    SendClientMessageExplayeridCOLOR_LAWNGREEN" " );
    
SendClientMessageExplayeridCOLOR_LAWNGREEN" " );
    
SendClientMessageExplayeridCOLOR_LAWNGREEN" " );
    
SendClientMessageExplayeridCOLOR_LAWNGREEN" " );
    
SendClientMessageExplayeridCOLOR_LAWNGREEN" " );
    
SendClientMessageExplayeridCOLOR_LIGHTBLUE"---------------------------------------------------" );
    
SendClientMessageExplayeridCOLOR_LIGHTBLUE"Welcome to City Life Roleplay" ); 
    
SendClientMessageExplayeridCOLOR_LIGHTBLUE"Homepage: www.citylife.eu5.org); 
    
SendClientMessageExplayeridCOLOR_LIGHTBLUE"TeamSpeak: Comming soon" ); 
    
SendClientMessageExplayeridCOLOR_LIGHTBLUE"Please wait for this gamemode to load... " ); 
    
SendClientMessageExplayeridCOLOR_LIGHTBLUE"---------------------------------------------------" ); 
Reply
#6

Give me these lines
Quote:

C:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(11092) : warning 202: number of arguments does not match definition
C:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(11095) : warning 202: number of arguments does not match definition
C:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(11095) : warning 202: number of arguments does not match definition
C:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(11095) : warning 202: number of arguments does not match definition
C:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(11095) : warning 202: number of arguments does not match definition
C:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(11095) : warning 202: number of arguments does not match definition
C:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(11095) : warning 202: number of arguments does not match definition
C:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(11095) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


8 Warnings.

It's impossible to work this way.
Reply
#7

PHP код:
11092 SendClientMessageExplayeridCOLOR_LIGHTBLUE"Welcome to City Life Roleplay (Version %s)",SERVER_GM_TEXT );
11095 -     SendClientMessageExplayeridCOLOR_LIGHTBLUE"Registrations: %d Peak players recorded: %d (%d/%d/%d - %d:%s)",TotalRegister,MaxPlayersConnected,MPDay,MPMonth,MPYear,MPHour,formatmin); 
Reply
#8

You're filling the SendClientMessageEx with too many params.
Please post your SendClientMessageEx function.
Reply
#9

PHP код:
#define SendFormattedMessage(%0,%1,%2) do{new _str[128]; format(_str,128,%2); SendClientMessageEx(%0,%1,_str);}while(FALSE)

SendClientMessageEx(playeridcolorstring[])
{
    if(
InsideMainMenu[playerid] == || InsideTut[playerid] == || ActiveChatbox[playerid] == 0)
        return 
0;

    else 
SendClientMessage(playeridcolorstring);
    return 
1;

Reply
#10

Replace the two lines of SendClientMessageEx with SendFormattedMessage.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)