Amaroq Posted December 13, 2017 Share Posted December 13, 2017 Salut! In acest topic voi posta functii folositoare nu numai pentru incepatori, ci pentru toata lumea. Daca vreti, puteti da reply sau PM cu o functie si o voi adauga. V-as ruga sa nu faceti mai multe posturi cu aceeasi functie. Daca si dvs. aveti o functie care este deja in comentarii, dati up la acel comentariu. I. STOCKS Aici vor sta stock-urile. Viteza stock GetSpeed(playerid) { new Float:Vx,Float:Vy,Float:Vz,Float:rtn; if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz); rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2))); return floatround(rtn * 100 * 1.61); } Cu acest stock puteti vedea viteza unui jucator in KM. Poate fi folosita la anti-cheat sau la vitezometru. * Topicul nu este complet! Voi continua lista mai tarziu, cand ajung acasa si am acces la mai multe functii! Rog administratorii sa nu inchida topicul. 1 Link to comment Share on other sites More sharing options...
Amaroq Posted December 18, 2017 Author Share Posted December 18, 2017 (edited) Jucator random stock GetRandomPlayer() { foreach(Player, i) { if(IsPlayerConnected(i)) { return i; } } return 0; } Cu acest stock puteti alege un jucator aleatoriu. Acest stock poate fi folosit la extrageri. Atentie! Aveti nevoie de foreach pentru a functiona stock-ul. Daca nu aveti foreach, inlocuiti foreach(Player, i) cu for(new i; i < GetPlayerPoolSize(); i++) Edited December 18, 2017 by Wolfie Link to comment Share on other sites More sharing options...
C0stin Posted January 5, 2018 Share Posted January 5, 2018 Folositor! Link to comment Share on other sites More sharing options...
EduardLFC Posted January 6, 2018 Share Posted January 6, 2018 Mulțam, chiar aveam nevoie. Link to comment Share on other sites More sharing options...
RaiN ZEW Posted January 9, 2018 Share Posted January 9, 2018 Frumos. Ai ↑ de la mine. <3 Link to comment Share on other sites More sharing options...
Madalin Posted February 13, 2018 Share Posted February 13, 2018 (edited) E cam inactiv topicul + că stock-urile ăstea se pot găsi în orice gamemode. Edited February 13, 2018 by South Madutzu Link to comment Share on other sites More sharing options...
Amaroq Posted February 23, 2018 Author Share Posted February 23, 2018 (edited) Imi cer scuze pentru inactivitate. Numere FormatNumber(number) { new Str[15]; format(Str, 15, "%d", number); if (strlen(Str) < sizeof(Str)) { if (number >= 1000 && number < 10000) strins( Str, ",", 1, sizeof(Str)); else if (number >= 10000 && number < 100000) strins(Str, ",", 2, sizeof(Str)); else if (number >= 100000 && number < 1000000) strins(Str, ",", 3, sizeof(Str)); else if (number >= 1000000 && number < 10000000) strins(Str, ",", 1, sizeof(Str)),strins(Str, ",", 5, sizeof(Str)); else if (number >= 10000000 && number < 100000000) strins(Str, ",", 2, sizeof(Str)),strins(Str, ",", 6, sizeof(Str)); else if (number >= 100000000 && number < 1000000000) strins(Str, ",", 3, sizeof(Str)),strins(Str, ",", 7, sizeof(Str)); else if (number >= 1000000000 && number < 10000000000) strins(Str, ",", 1, sizeof(Str)), strins(Str, ",", 5, sizeof(Str)), strins(Str, ",", 9, sizeof(Str)); else format(Str, 10, "%d", number); } else format( Str, 15, "<BUG>" ); return Str; } Cu acest stock puteti formata numere, il gasiti oriunde, deci va rog sa nu mai spuneti ca il gasesti in orice GM si dau copy-paste. Ce face mai exact? Formateaza un numar. Ex: In loc de 1000000 va aparea 1,000,000. O sa va dau un exemplu de folosire si va voi si explica new str[64], bani; // mesajul si banii bani = GetPlayerMoney(playerid); // ii aflam banii format(str, sizeof(str), "Ai $%s bani.", FormatNumber(bani)); // Formatam mesajul, ATENTIE!!!! Sa nu puneti niciodata %i sau %d. Numai %s. Altfel, va bugui tot sistemul la care lucrati! SendClientMessage(playerid, 0xFF0080, str); // trimitem mesajul // la FormatNumber(bani) se poate scrie direct si FormatNumber(GetPlayerMoney(playerid)), scotand astfel 2 linii. Este la latitudinea voastra cum utilizati. Sper ca am fost de ajutor, astept reply sau PM cu nelamuriri in legatura cu orice problema, fie cu ce postez, fie cu ce lucrati voi. Va doresc o zi frumoasa ! Edited February 23, 2018 by Wolfie Link to comment Share on other sites More sharing options...
Dookie Posted March 9, 2018 Share Posted March 9, 2018 Topic inactiv de mai bine de 2 saptamani. Link to comment Share on other sites More sharing options...
Recommended Posts