Szerző Téma: Leggazdagabb Játékos  (Megtekintve 926 alkalommal)

Nem elérhető Stramm

  • 193
    • Profil megtekintése
Leggazdagabb Játékos
« Dátum: 2015. Május 07. - 15:12:50 »
0
Sziasztok Tudnátok nekem egy Olyan FilterSciptet Linkelni vagy Írni ami   Ki írja a Szerver 3 Leggazdagabb játékosát. azok közűl akik a szerveren vannak ??    playerok tudják megnézni pl : /list parancsal Előre is köszönöm a segítségeteket
« Utoljára szerkesztve: 2015. Május 07. - 15:15:42 írta ƒlaﻛh »

Nem elérhető huhboy

  • 894
  • huhboy
    • Profil megtekintése
Leggazdagabb Játékos
« Válasz #1 Dátum: 2015. Május 07. - 17:10:06 »
0

#define COLOR_WHITE 0xffffffaa
CMD:list(playerid,params[])
{
   new string[128], Slot1 = -1, Slot2 = -1, Slot3 = -1, Slot4 = -1;
        new HighestCash = -9999;
   SendClientMessage(playerid,green,\"|- A Leggazdagabbak: -|\");
for(new x=0; x<MAX_PLAYERS; x++)
if(IsPlayerConnected(x))
if(GetPlayerMoney(x) >= HighestCash)
{
HighestCash = GetPlayerMoney(x);
Slot1 = x;
}
HighestCash = -9999;
for(new x=0; x<MAX_PLAYERS; x++)
if(IsPlayerConnected(x) && x != Slot1)
if(GetPlayerMoney(x) >= HighestCash)
{
HighestCash = GetPlayerMoney(x);
Slot2 = x;
}
HighestCash = -9999;
for(new x=0; x<MAX_PLAYERS; x++)
if(IsPlayerConnected(x) && x != Slot1 && x != Slot2)
if(GetPlayerMoney(x) >= HighestCash)
{
HighestCash = GetPlayerMoney(x);
Slot3 = x;
}
HighestCash = -9999;
for(new x=0; x<MAX_PLAYERS; x++)
if(IsPlayerConnected(x) && x != Slot1 && x != Slot2 && x != Slot3)
if(GetPlayerMoney(x) >= HighestCash)
{
HighestCash = GetPlayerMoney(x);
Slot4 = x;
}
format(string, sizeof(string), \"(%d) %s - $%d\", Slot1,PlayerName2(Slot1),GetPlayerMoney(Slot1));
SendClientMessage(playerid,COLOR_WHITE,string);
if(Slot2 != -1){
format(string, sizeof(string), \"(%d) %s - $%d\", Slot2,PlayerName2(Slot2),GetPlayerMoney(Slot2));
SendClientMessage(playerid,COLOR_WHITE,string);
}
if(Slot3 != -1){
format(string, sizeof(string), \"(%d) %s - $%d\", Slot3,PlayerName2(Slot3),GetPlayerMoney(Slot3));
SendClientMessage(playerid,COLOR_WHITE,string);
}
if(Slot4 != -1){
format(string, sizeof(string), \"(%d) %s - $%d\", Slot4,PlayerName2(Slot4),GetPlayerMoney(Slot4));
SendClientMessage(playerid,COLOR_WHITE,string);
}
return 1;
}

Nem elérhető Kovacs_Richard

  • 1743
  • HRP Fejlesztő
  • Discord: Kovacs_Richard#0321
    • Profil megtekintése
    • Hun Role Play Web
Leggazdagabb Játékos
« Válasz #2 Dátum: 2015. Május 08. - 08:45:54 »
0
kódot tudok adni ha ez segít :)
 
for(var i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
   money = GetPlayerMoney(i);
   // 1.
   if(money > GetPlayerMoney(gazd[0]))
   {
      gazd[2] = gazd[1];
      gazd[1] = gazd[0];
      gazd[0] = i;
   }
   // 2.
   else if(money > GetPlayerMoney(gazd[1]))
   {
      gazd[2] = gazd[1];
      gazd[1] = i;
   }
   // 3.
   else if(money > GetPlayerMoney(gazd[2]))
   {
      gazd[2] = i;
   }
}
}
Régóta nem tevékenykedem, mint SA-MP scripter.
HRP Fejlesztő.

Nem elérhető Pedró

  • 3341
  • 2014 © Az év Szkriptere
    • Profil megtekintése
Leggazdagabb Játékos
« Válasz #3 Dátum: 2015. Május 08. - 09:51:47 »
+1
ajánlom ezt az include-t
zsolesszka készítette még anno :)
http://forum.sa-mp.com/showthread.php?t=139776

Nem elérhető Stramm

  • 193
    • Profil megtekintése
Leggazdagabb Játékos
« Válasz #4 Dátum: 2015. Május 08. - 13:59:20 »
0
Köszi Mindenkinek Jó lett :))  :thumbsup:

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal