Gang list
#1

Hello, i wouldnt ask this if i had any idea how to do it, but how to get a gang list when you write a command?

For example you write /gangs and you get:

Код:
Gang1 Leader 1
Gang2 Leader 2
Gang3 Leader 3
Here is the part of the creation command:

Код:
if (strcmp("/cgang", cmdtext, true, 6) == 0)
{
for(new i=0; i<MAX_GANGS; i++)
{
if(!gangDB[i][isgang])
{
new pname[MAX_PLAYER_NAME],msg[128];
GetPlayerName(playerid,pname,sizeof(pname));
strmid(gangDB[i][leader],pname,0,MAX_PLAYER_NAME,MAX_PLAYER_NAME);
strmid(gangDB[i][ganame],cmdtext[7],0,MAX_PLAYER_NAME,MAX_PLAYER_NAME);
gangDB[i][isgang]=true;
gangDB[i][members]=1;
gplayerDB[playerid][pgang]=i;
gplayerDB[playerid][islead]=true;
GetPlayerPos(playerid,gangDB[i][bustine][0],gangDB[i][bustine][1],gangDB[i][bustine][2]);
format(msg,sizeof(msg),"Gang named: \"%s\" created. Your base is here.",cmdtext[7]);
SendClientMessage(playerid,GANG_COLOR,msg);
return 1;
}
}
SendClientMessage(playerid,GANG_COLOR,"* Sorry, but the maximum number of gangs has been reached.");
return 1;
}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)