07.10.2013, 11:17
How to see my players Commands.. even if it was wrong cmd like this /gdgdf
public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )
{
if( !success )
{
new
msg_[ 64 ]
;
format( msg_, sizeof( msg_ ), "The command \"%s\" does not exist", cmdtext );
SendClientMessage( playerid, -1, msg_ );
}
return 1;
}
pawn Код:
|
public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )
{
new
msg_[ 64 ],
name_[ MAX_PLAYER_NAME ]
;
GetPlayerName( playerid, name_, MAX_PLAYER_NAME );
format( msg_, sizeof( msg_ ), "%s used: %s", name_, cmdtext );
// SendMessageToAdmins or if you have any function to do that..
// OR ELSE.. USE:
for(new i = 0; i < MAX_PLAYERS; i++ )
{
if( !IsPlayerConnected( i ) || pInfo[ i ][ pAdmin ] < 1 ) continue;
// Change pInfo[ i ][ pAdmin ] to what you use for admins' levels
SendClientMessage( i, 0xFFFF00FF, msg_ )
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[]) { new playername[MAX_PLAYER_NAME]; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerAdmin(i)) { GetPlayerName(playerid, playername, sizeof(playername)); format(string, sizeof(string), "***%s (%d) typed: %s", playername,playerid,cmdtext); SendClientMessage(i, grey, string); } } }
pawn Код:
|
public OnPlayerCommandPerformed( playerid, cmdtext[ ], success ) { new msg_[ 64 ], name_[ MAX_PLAYER_NAME ] ; GetPlayerName( playerid, name_, MAX_PLAYER_NAME ); format( msg_, sizeof( msg_ ), "%s used: %s", name_, cmdtext ); // SendMessageToAdmins or if you have any function to do that.. // OR ELSE.. USE: for(new i = 0; i < MAX_PLAYERS; i++ ) { if( !IsPlayerConnected( i ) || if( IsPlayerAdmin( i )) continue; // Change pInfo[ i ][ pAdmin ] to what you use for admins' levels SendClientMessage( i, 0xFFFF00FF, msg_ ) } return 1; }
C:\Users\John\Desktop\Server\gamemodes\FristGM.pwn(651) : error 029: invalid expression, assumed zero C:\Users\John\Desktop\Server\gamemodes\FristGM.pwn(651) : error 001: expected token: ";", but found "continue" C:\Users\John\Desktop\Server\gamemodes\FristGM.pwn(653) : warning 225: unreachable code C:\Users\John\Desktop\Server\gamemodes\FristGM.pwn(654) : error 001: expected token: ";", but found "}" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Thank you sir and sorry for ur time but i got this errors
[code]public OnPlayerCommandPerformed( playerid, cmdtext[ ], success ) { new msg_[ 64 ], name_[ MAX_PLAYER_NAME ] ; GetPlayerName( playerid, name_, MAX_PLAYER_NAME ); format( msg_, sizeof( msg_ ), "%s used: %s", name_, cmdtext ); // SendMessageToAdmins or if you have any function to do that.. // OR ELSE.. USE: for(new i = 0; i < MAX_PLAYERS; i++ ) { if( !IsPlayerConnected( i ) || if( IsPlayerAdmin( i )) continue; // Change pInfo[ i ][ pAdmin ] to what you use for admins' levels SendClientMessage( i, 0xFFFF00FF, msg_ ) } return 1; } |
SendClientMessage( i, 0xFFFF00FF, msg_ )
SendClientMessage( i, 0xFFFF00FF, msg_ );
SendClientMessage( i, 0xFFFF00FF, msg_ );
if( !IsPlayerConnected( i ) || if( IsPlayerAdmin( i )) continue;
if( !IsPlayerConnected( i ) || !IsPlayerAdmin( i ) ) continue;
// If the player is not connected or not an RCON admin, skip it and go to the next player.