SA-MP Forums Archive
How to number this string 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)
+--- Thread: How to number this string list? (/showthread.php?tid=526463)



How to number this string list? - gychem - 17.07.2014

I've tried it but I could not get this fixed, someone knows how to do it?

Код:
CMD:families(playerid, params[])
{
	new string[768];
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	for(new idx=1; idx<MAX_FAMILIES; idx++)
	{
	    format(string, sizeof(string), "- {00b3f0}Name: {ffffff}%s {000000}| {00b3f0}Leader: {ffffff}%s {000000}| {00b3f0}Members: {ffffff}%d {000000}| {00b3f0}Strikes: {ffffff}%d", FamInfo[idx][fName], FamInfo[idx][fLeader], FamInfo[idx][fMembers], FamInfo[idx][fStrikes]);
	    SendClientMessage(playerid, COLOR_WHITE, string);
	}
	return 1;
}



Re: How to number this string list? - GeekSiMo - 17.07.2014

What is the Error !??


Re: How to number this string list? - Kyance - 17.07.2014

Quote:
Originally Posted by gychem
Посмотреть сообщение
I've tried it but I could not get this fixed, someone knows how to do it?

Код:
CMD:families(playerid, params[])
{
	new string[768];
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	for(new idx=1; idx<MAX_FAMILIES; idx++)
	{
	    format(string, sizeof(string), "- {00b3f0}Name: {ffffff}%s {000000}| {00b3f0}Leader: {ffffff}%s {000000}| {00b3f0}Members: {ffffff}%d {000000}| {00b3f0}Strikes: {ffffff}%d", FamInfo[idx][fName], FamInfo[idx][fLeader], FamInfo[idx][fMembers], FamInfo[idx][fStrikes]);
	    SendClientMessage(playerid, COLOR_WHITE, string);
	}
	return 1;
}
pawn Код:
CMD:families(playerid, params[])
{
    new string[768];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    for(new idx=1; idx<MAX_FAMILIES; idx++)
    {
        format(string, sizeof(string), "- #%d | {00b3f0}Name: {ffffff}%s {000000}| {00b3f0}Leader: {ffffff}%s {000000}| {00b3f0}Members: {ffffff}%d {000000}| {00b3f0}Strikes: {ffffff}%d", idx, FamInfo[idx][fName], FamInfo[idx][fLeader], FamInfo[idx][fMembers], FamInfo[idx][fStrikes]);
        SendClientMessage(playerid, COLOR_WHITE, string);
    }
        string = "\0";
    return 1;
}
This?
It would show;
- #1 | Name: Ballas | Leader: Big Smoke | Members: 567| Strikes: 1
- #2 | Name: Grove Street | Leader: CJ | Members: 9001 | Strikes: 0
...

EDIT: You should check if the Family actually exists, before creating the text/sending the message.


Re: How to number this string list? - gychem - 17.07.2014

Going to try this, thanks


Re: How to number this string list? - gychem - 17.07.2014

It doesn't work,