Jump to content

MihaiGG

Membru
  • Posts

    5
  • Joined

  • Last visited

Everything posted by MihaiGG

  1. salut, cum as putea afla numarul de elemente dintr-un array? Spre exemplu, incerc sa fac un sistem de skinuri la factiune: ShowModelSelectionMenuEx(playerid, FactionsSkins[PlayerInfo[playerid][pMember]-1], items_count , "Faction Skins", FACTION_SKINS); E ok, imi apar skinurile dar daca items_count este mai mare decat numarul de skinuri de la o factiune imi adauga skinuri si din urmatoarea factiune pana atinge items_count. new FactionsSkins[][] = { {71, 280, 281, 282, 283, 284, 265, 266, 267, 306, 307, 309}, {71, 280, 281, 282, 283, 284, 265, 266, 267, 306, 307, 309}, {71, 280, 281, 282, 283, 284, 265, 266, 267, 306, 307, 309}, {76, 295, 286, 163, 164, 165, 166} }; nu stiu cum pot afla numarul de elemente, spre exemplu la primele 3 unde sunt 12 ID-uri e de ajuns si o explicatie sau un exemplu
  2. am inteles, e mai ok sa folosesti iteratori in cele mai multe cazuri ca sa nu faci loop peste toti jucatorii conectati? sau daca e un numar mai mare de iteratori scade din performanta?
  3. salut, am si eu o intrebare care e mai exact chestia cu string[0] = EOS? e mai ok sa folosesti un string declarat global iar apoi mereu cand trebuie sa utilizezi stringul sa-l formatezi cu E0S?
  4. mersi frumos!
  5. salut, as dori un sfat sau o parere cum as putea face comanda /top in ordine descrescatoare, mafia cu cele mai multe turfuri sa fie afisata prima si cea cu cele mai putine ultima CMD:top(playerid, params[]) { new p=0,t=0,s=0,r=0,a=0, b=0,x = 0, y = 0, z = 0; foreach(new i : GangTurfs) { if(TurfInfo[i][zOwned] == 15) t++; if(TurfInfo[i][zOwned] == 16) p++; if(TurfInfo[i][zOwned] == 17) s++; if(TurfInfo[i][zOwned] == 18) r++; if(TurfInfo[i][zOwned] == 19) a++; if(TurfInfo[i][zOwned] == 20) b++; if(TurfInfo[i][zOwned] == 21) x++; if(TurfInfo[i][zOwned] == 22) y++; if(TurfInfo[i][zOwned] == 23) z++; } SendClientMessage(playerid,COLOR_WHITE,"---------- Top Gangs ----------"); SendClientMessage(playerid,COLOR_WHITE, "{%s}%s {FFFFFF}- %d turfs", GetFactionColor(15), FactionName(15), t); SendClientMessage(playerid,COLOR_WHITE, "{%s}%s {FFFFFF}- %d turfs", GetFactionColor(16), FactionName(16), p); SendClientMessage(playerid,COLOR_WHITE, "{%s}%s {FFFFFF}- %d turfs", GetFactionColor(17), FactionName(17), s); SendClientMessage(playerid,COLOR_WHITE, "{%s}%s {FFFFFF}- %d turfs", GetFactionColor(18), FactionName(18), r); SendClientMessage(playerid,COLOR_WHITE, "{%s}%s {FFFFFF}- %d turfs", GetFactionColor(19), FactionName(19), a); SendClientMessage(playerid,COLOR_WHITE, "{%s}%s {FFFFFF}- %d turfs", GetFactionColor(20), FactionName(20), b); SendClientMessage(playerid,COLOR_WHITE, "{%s}%s {FFFFFF}- %d turfs", GetFactionColor(21), FactionName(21), x); SendClientMessage(playerid,COLOR_WHITE, "{%s}%s {FFFFFF}- %d turfs", GetFactionColor(22), FactionName(22), y); SendClientMessage(playerid,COLOR_WHITE, "{%s}%s {FFFFFF}- %d turfs", GetFactionColor(23), FactionName(23), z); SendClientMessage(playerid,COLOR_WHITE,"-------------------------------------"); return 1; }
×
×
  • 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.