24.06.2011, 11:31
Better use strfind, so you can search for parts of names:
Untested.
pawn Код:
dcmd_id( playerid, params[ ] ) {
if( !strlen( params ) ) {
SendClientMessage( playerid, -1, "Utilisation: '/id <nom du joueur>'" );
return 1;
}
for( new i = 0; i < MAX_PLAYERS; i++ ) {
new
pName[ 24 ],
string[ 128 ]
;
GetPlayerName( i, pName, 24 );
if( strfind( params, pName, true ) ) {
format( string, sizeof string, "%s's ID is %d", pName, i );
SendClientMessage( playerid, -1, string );
}
}
return 1;
}