SA-MP Forums Archive
Server stats when logging - 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: Server stats when logging (/showthread.php?tid=492555)



Server stats when logging - FaZeRs - 04.02.2014

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



Re: Server stats when logging - BullseyeHawk - 04.02.2014

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



Re: Server stats when logging - FaZeRs - 04.02.2014

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




Re: Server stats when logging - BullseyeHawk - 04.02.2014

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 ^


Re: Server stats when logging - FaZeRs - 04.02.2014

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



Re: Server stats when logging - BullseyeHawk - 04.02.2014

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.


Re: Server stats when logging - FaZeRs - 04.02.2014

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



Re: Server stats when logging - BullseyeHawk - 04.02.2014

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


Re: Server stats when logging - FaZeRs - 04.02.2014

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;




Re: Server stats when logging - BullseyeHawk - 04.02.2014

Replace the two lines of SendClientMessageEx with SendFormattedMessage.