16.11.2013, 22:30
Any one who can help me to make an /members without bug thanks
what does /members do? Does it show a list of members with a specified var like gUser[pid][member] == 1?
What is the code in the current command, what variable(s) are storing weather a user is a member or not. |
#define member(%0) ( return PlayerInfo[%0][pMember] )
YCMD:members(playerid, params[], help)
{
if(!member(playerid))
return 1;
SendClientMessage(playerid, -1, "______ MEMBERS ________");
foreach(Player, i)
{
if(member(i,member(playerid))
new string[16+MAX_PLAYER_NAME], name[24];
GetPlayerName(i, name, 24);
format(string, 40, "- %s", name);
SendClientMessage(playerid, -1, string);
}
SendClientMessage(playerid, -1, "______________________");
return true;
}
COMMAND:members( playerid, params[ ] )
{
for ( new i, p = GetMaxPlayers( ); i < p; i ++ )
{
if ( !IsPlayerConnected( playerid ) )
continue;
new iName[ 24 ], nameFormat[ 32 ], totalString[ 500 ] = "No one";
if ( gTeam[ i ] == gTeam[ playerid ] )
{
GetPlayerName( playerid, iName, 24 );
format( nameFormat, 32, "%s \n", nameFormat );
strcat( totalString, nameFormat );
}
}
ShowPlayerDialog( playerid, 1777, DIALOG_STYLE_LIST, "Gang members", totalString, "Okay", "Okay" );
return 1;
}