Help /admins -
Dan_Barocu - 23.01.2012
56324: error 035: argument type mismatch (argument 3)
56328: error 035: argument type mismatch (argument 3)
Line 56328 : strcat(admindialogstring,"{33AA33}%s - %s (On Duty)", admtext, sendername);
Line 56324 : strcat(admindialogstring,"{33AA33}%s - %s (OFF Duty)", admtext, sendername);
Admin Command in a Dialog BOX:
Код:
if (strcmp(cmd, "/admins", true) == 0)
{
new admindialogstring[1024];
if(IsPlayerConnected(playerid))
{
strcat(admindialogstring,"{33AA33}Admini Online");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] <= 1338 || PlayerInfo[i][pTester] >= 1)
{
new admtext[64];
if(PlayerInfo[i][pAppearList] == 0)
{
if(PlayerInfo[i][pAdmin] == 1338) { admtext = "Server Owner"; }
else if(PlayerInfo[i][pAdmin] == 1337) { admtext = "Server Scripter"; }
else if(PlayerInfo[i][pAdmin] == 6) { admtext = "Server Developer"; }
else if(PlayerInfo[i][pAdmin] == 5) { admtext = "Main Administrator"; }
else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Senior Administrator"; }
else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Administrator"; }
else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Global Moderator"; }
else if(PlayerInfo[i][pAdmin] == 1) { admtext = "Moderator"; }
else if(PlayerInfo[i][pTester] == 3) { admtext = "Lead Tester"; }
else if(PlayerInfo[i][pTester] == 2) { admtext = "Tester"; }
else if(PlayerInfo[i][pTester] == 1) { admtext = "Trial Tester"; }
else { admtext = "Unknown Rank"; }
}
GetPlayerName(i, sendername, sizeof(sendername));
if(PlayerInfo[i][pAdminDuty] == 0 && PlayerInfo[i][pAppearList] == 0)
{
strcat(admindialogstring,"{33AA33}%s - %s (OFF Duty)", admtext, sendername);
}
else if(PlayerInfo[i][pAdminDuty] == 1 && PlayerInfo[i][pAppearList] == 0)
{
strcat(admindialogstring,"{33AA33}%s - %s (On Duty)", admtext, sendername);
}
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"{33AA33}Admins Online",admindialogstring,"Close","");
}
}
}
}
return 1;
}
+ REP
Re: Help /admins -
Konstantinos - 23.01.2012
strcat is strcat and format is format. You cannot use the format in the strcat's usage.
pawn Код:
format( admindialogstring, sizeof( admindialogstring ), "{33AA33}%s - %s (On Duty)", admtext, sendername );
Strcat be used when the line is too long. It's useless in every line with 128 Chars to use strcat.
In case you want to make a format that is too long, then use strcat like that
pawn Код:
format( admindialogstring, sizeof( admindialogstring ), "{33AA33}%s - %s (On Duty)................. too long.....", admtext, sendername );
new
Msg[ 500 ]; // Only if it has more than 400+ Chars ( It used more in Dialog Messages )
strcat( Msg, admindialogstring );
Re: Help /admins -
Dan_Barocu - 23.01.2012
But only me i appear in /admins if i go online or offline
Re: Help /admins -
Konstantinos - 23.01.2012
pawn Код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
if( strcmp( "/admins", cmdtext, true ) == 0 )
{
new
admindialogstring[ 512 ];
if( IsPlayerConnected( playerid ) )
{
SendClientMessage( playerid, -1, "{33AA33}Admini Online" );
for( new i = 0; i < MAX_PLAYERS; i ++ )
{
if( IsPlayerConnected( i ) )
{
if( PlayerInfo[ i ][ pAdmin ] >= 1 && PlayerInfo[ i ][ pAdmin ] <= 1338 || PlayerInfo[ i ][ pTester ] >= 1 )
{
new
admtext[ 64 ], Msg1[ 40 ], Msg2[ 40 ];
if(PlayerInfo[ i ][ pAppearList ] == 0 )
{
if(PlayerInfo[i][pAdmin] == 1338) { admtext = "Server Owner"; }
else if( PlayerInfo[ i ][ pAdmin ] == 1337) { admtext = "Server Scripter"; }
else if( PlayerInfo[ i ][ pAdmin ] == 6) { admtext = "Server Developer"; }
else if( PlayerInfo[ i ][ pAdmin ] == 5) { admtext = "Main Administrator"; }
else if( PlayerInfo[ i ][ pAdmin ] == 4) { admtext = "Senior Administrator"; }
else if( PlayerInfo[ i ][ pAdmin ] == 3) { admtext = "Administrator"; }
else if( PlayerInfo[ i ][ pAdmin ] == 2) { admtext = "Global Moderator"; }
else if( PlayerInfo[ i ][ pAdmin ] == 1) { admtext = "Moderator"; }
else if( PlayerInfo[ i ][ pTester ] == 3) { admtext = "Lead Tester"; }
else if( PlayerInfo[ i ][ pTester ] == 2) { admtext = "Tester"; }
else if( PlayerInfo[ i ][ pTester ] == 1) { admtext = "Trial Tester"; }
else { admtext = "Unknown Rank"; }
}
GetPlayerName( i, sendername, sizeof( sendername ) );
if( PlayerInfo[ i ][ pAdminDuty ] == 0 && PlayerInfo[ i ][ pAppearList ] == 0 )
{
format( Msg1, sizeof( Msg1 ), "{33AA33}%s - %s (OFF Duty)", admtext, sendername );
}
else if( PlayerInfo[ i ][ pAdminDuty ] == 1 && PlayerInfo[ i ][ pAppearList ] == 0 )
{
format(Msg2, sizeof( Msg2 ), "{33AA33}%s - %s (On Duty)", admtext, sendername) ;
}
strcat( admindialogstring, Msg1 );
strcat( admindialogstring, Msg2 );
ShowPlayerDialog( playerid, 6000, DIALOG_STYLE_MSGBOX, "{33AA33}Admins Online", admindialogstring, "Close", "");
return 1;
}
}
}
}
}
return 0;
}
Re: Help /admins -
Dan_Barocu - 23.01.2012
Код:
if (strcmp(cmd, "/admins", true) == 0)
{
new admindialogstring[1024];
if(IsPlayerConnected(playerid))
{
strcat(admindialogstring,"{33AA33}Admini Online");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] <= 1338 || PlayerInfo[i][pTester] >= 1)
{
new admtext[64];
if(PlayerInfo[i][pAppearList] == 0)
{
if(PlayerInfo[i][pAdmin] == 1338) { admtext = "Server Owner"; }
else if(PlayerInfo[i][pAdmin] == 1337) { admtext = "Server Scripter"; }
else if(PlayerInfo[i][pAdmin] == 6) { admtext = "Server Developer"; }
else if(PlayerInfo[i][pAdmin] == 5) { admtext = "Main Administrator"; }
else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Senior Administrator"; }
else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Administrator"; }
else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Global Moderator"; }
else if(PlayerInfo[i][pAdmin] == 1) { admtext = "Moderator"; }
else if(PlayerInfo[i][pTester] == 3) { admtext = "Lead Tester"; }
else if(PlayerInfo[i][pTester] == 2) { admtext = "Tester"; }
else if(PlayerInfo[i][pTester] == 1) { admtext = "Trial Tester"; }
else { admtext = "Unknown Rank"; }
}
GetPlayerName(i, sendername, sizeof(sendername));
if(PlayerInfo[i][pAdminDuty] == 0 && PlayerInfo[i][pAppearList] == 0)
{
format( admindialogstring, sizeof( admindialogstring ), "{E60000}%s -{000099}%s {99FF00}(OFF Duty)", admtext, sendername );
}
else if(PlayerInfo[i][pAdminDuty] == 1 && PlayerInfo[i][pAppearList] == 0)
{
format( admindialogstring, sizeof( admindialogstring ),"{E60000}%s -{000099}%s {99FF00}(On Duty)", admtext, sendername );
}
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"{33AA33}Admins Online",admindialogstring,"Close","");
}
}
}
}
return 1;
}
Only me,i appear on list
Re: Help /admins -
Konstantinos - 23.01.2012
Are you the only on the server ( localhost ), or did you test it with others ?
That should work! I forgot to add the line
pawn Код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
if( strcmp( "/admins", cmdtext, true ) == 0 )
{
new
admindialogstring[ 512 ];
if( IsPlayerConnected( playerid ) )
{
SendClientMessage( playerid, -1, "{33AA33}Admini Online" );
for( new i = 0; i < MAX_PLAYERS; i ++ )
{
if( IsPlayerConnected( i ) )
{
if( PlayerInfo[ i ][ pAdmin ] >= 1 && PlayerInfo[ i ][ pAdmin ] <= 1338 || PlayerInfo[ i ][ pTester ] >= 1 )
{
new
admtext[ 64 ], Msg1[ 40 ], Msg2[ 40 ];
if(PlayerInfo[ i ][ pAppearList ] == 0 )
{
if(PlayerInfo[i][pAdmin] == 1338) { admtext = "Server Owner"; }
else if( PlayerInfo[ i ][ pAdmin ] == 1337) { admtext = "Server Scripter"; }
else if( PlayerInfo[ i ][ pAdmin ] == 6) { admtext = "Server Developer"; }
else if( PlayerInfo[ i ][ pAdmin ] == 5) { admtext = "Main Administrator"; }
else if( PlayerInfo[ i ][ pAdmin ] == 4) { admtext = "Senior Administrator"; }
else if( PlayerInfo[ i ][ pAdmin ] == 3) { admtext = "Administrator"; }
else if( PlayerInfo[ i ][ pAdmin ] == 2) { admtext = "Global Moderator"; }
else if( PlayerInfo[ i ][ pAdmin ] == 1) { admtext = "Moderator"; }
else if( PlayerInfo[ i ][ pTester ] == 3) { admtext = "Lead Tester"; }
else if( PlayerInfo[ i ][ pTester ] == 2) { admtext = "Tester"; }
else if( PlayerInfo[ i ][ pTester ] == 1) { admtext = "Trial Tester"; }
else { admtext = "Unknown Rank"; }
}
GetPlayerName( i, sendername, sizeof( sendername ) );
if( PlayerInfo[ i ][ pAdminDuty ] == 0 && PlayerInfo[ i ][ pAppearList ] == 0 )
{
format( Msg1, sizeof( Msg1 ), "{33AA33}%s - %s (OFF Duty)\n", admtext, sendername );
}
else if( PlayerInfo[ i ][ pAdminDuty ] == 1 && PlayerInfo[ i ][ pAppearList ] == 0 )
{
format(Msg2, sizeof( Msg2 ), "{33AA33}%s - %s (On Duty)\n", admtext, sendername) ;
}
strcat( admindialogstring, Msg1 );
strcat( admindialogstring, Msg2 );
ShowPlayerDialog( playerid, 6000, DIALOG_STYLE_MSGBOX, "{33AA33}Admins Online", admindialogstring, "Close", "");
return 1;
}
}
}
}
}
return 0;
}
Re: Help /admins -
Dan_Barocu - 23.01.2012
92.82.80.115:7777 please come on it so i test it to see please.
Re: Help /admins -
Dan_Barocu - 23.01.2012
please come alittle bit 92.82.80.115:7777 so i test cmd /admins!
Re: Help /admins -
Dan_Barocu - 23.01.2012
only me...i appear on a list and i tried with someone..
Re: Help /admins -
Dan_Barocu - 23.01.2012
dwane your cmd doesent work the pawn says not responding..