SA-MP Forums Archive
Gang list - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Gang list (/showthread.php?tid=265486)



Gang list - Moron - 01.07.2011

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;
}
}