Jump to content
  • 0

Ajutor comanda richlist


alexutu

Question

Salutare Sa-Mp.ro ma puteti ajuta ca sa tranform aceasta comanda

[pawn]    if (strcmp(cmd, "/richlist", true) == 0)

{

        if(IsPlayerConnected(playerid))

    {

        if(PlayerInfo[playerid][pAdmin] < 1)

        {

            SendClientMessage(playerid, COLOR_GREY, "** You're no authorized to use that command . ");

            return 1;

        }

            GetPlayerName(playerid, sendername, sizeof(sendername));

format(string, sizeof(string), "{FF2C00}[AdmWarning]: {33FF33}%s {FFFFFF}Has Checked For Rich Users Online.", sendername);

ABroadCast(COLOR_LIGHTRED, string, 5);

SendClientMessage(playerid, COLOR_LIGHTRED, "Rich Users online:");

for(new i = 0; i < MAX_PLAYERS; i++)

{

if(IsPlayerConnected(i))

{

    if(GetPlayerMoney(i) >= 5000000 || PlayerInfo[pAccount] >= 5000000)

    {

        GetPlayerName(i, sendername, sizeof(sendername));

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

format(string, 128, "%s (%d) - In Hand: $%d | In Bank: $%d", sendername, i, GetPlayerMoney(i), PlayerInfo[pAccount]);

SendClientMessage(playerid, COLOR_YELLOW, string);

}

}

}

}

return 1;

}

[/pawn]

sa poata fi folosita de toti playeri,iar aceasta sa le arata top 10 cei maai bogati playeri acestea fin clasificati in functie de bani.  Sa scrie ceva de genul

1.Shyft Portofel 1000 Banca 2000

2.x Portofel 900 Banca 1000

(?_?_?_?(???????????(??_?_?_??K??E??N??T?????????_?_?_?_?()??

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

Ti`am indeplinit doar 2 din cerinte, anume:

1

Sa scrie ceva de genul

1.Shyft Portofel 1000 Banca 2000
2.x Portofel 900 Banca 1000
2
sa poata fi folosita de toti playeri
 if (strcmp(cmd, "/richlist", true) == 0)
	{
        if(IsPlayerConnected(playerid))
	    {
            GetPlayerName(playerid, sendername, sizeof(sendername));
			SendClientMessage(playerid, COLOR_LIGHTRED, "Rich Users online:");
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i))
				{
				    if(GetPlayerMoney(i) >= 5000000 || PlayerInfo[i][pAccount] >= 5000000)
				    {
				        GetPlayerName(i, sendername, sizeof(sendername));
						GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						format(string, 128, "%s (%d) - Portofel: $%d | Banca: $%d", sendername, i, GetPlayerMoney(i), PlayerInfo[i][pAccount]);
						SendClientMessage(playerid, COLOR_YELLOW, string);
					}
				}
			}
		}
		return 1;
	}

A fost usor sa te iubim ...,

      Acum e imposibil sa te uitam !

Link to comment
Share on other sites

Ca sa faci un top 10 trebuie sa folosesti SQLite sau MySQL , altfel nu poti , poti dar poti face doar topul celor online daca nu ma insel , oricum

Uite comanda , care o pot folosi toti , nu doar admini

[pawn] if (strcmp(cmd, "/richlist", true) == 0)

{

        if(IsPlayerConnected(playerid))

    {

            GetPlayerName(playerid, sendername, sizeof(sendername));

format(string, sizeof(string), "{FF2C00}[AdmWarning]: {33FF33}%s {FFFFFF}Has Checked For Rich Users Online.", sendername);

ABroadCast(COLOR_LIGHTRED, string, 5);

SendClientMessage(playerid, COLOR_LIGHTRED, "Rich Users online:");

for(new i = 0; i < MAX_PLAYERS; i++)

{

if(IsPlayerConnected(i))

{

    if(GetPlayerMoney(i) >= 5000000 || PlayerInfo[pAccount] >= 5000000)

    {

        GetPlayerName(i, sendername, sizeof(sendername));

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

format(string, 128, "%s (%d) - In Hand: $%d | In Bank: $%d", sendername, i, GetPlayerMoney(i), PlayerInfo[pAccount]);

SendClientMessage(playerid, COLOR_YELLOW, string);

}

}

}

}

return 1;

}[/pawn]

Massari e curva mea

Link to comment
Share on other sites

Fix asta vreau sa imi scrie asa

1.Shyft In Hand 1000 In Bank 100 Total:1100

2. alexutu In Hand 900 In Bank 100 Total 1000

Daca nu sunt eu on(shyft) sa apara cel care e cel mai bogat in acel mement pe svr

(?_?_?_?(???????????(??_?_?_??K??E??N??T?????????_?_?_?_?()??

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.