Jump to content

BuhaAdv

Member
  • Posts

    23
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by BuhaAdv

  1. Recomand, baiatu' stie ce face
  2. Daca folosesti y_timers sau ai libraria YSI iti recomand sa faci in felul urmator, deoarece va fii mult mai optim decat daca ai folosi metodele traditionale: #include <YSI\y_timers> new Timer:PauzaPeste[ MAX_PLAYERS ], PotPrindeBoss[ MAX_PLAYERS ]; public OnPlayerConnect( playerid ){ PotPrindeBoss[ playerid ] = 0; return 1; } CMD:fish( playerid, params[ ] ){ if( PotPrindeBoss[ playerid ] > 0 ){ new info_text[ 56 ]; format( info_text, sizeof info_text, "Poti prinde un alt peste peste %d secunde.", PotPrindeBoss[ playerid ] ); SendClientMessage( playerid, -1, info_text ); return 1; } /* bla...bla...bla ce ai tu pe aici */ PotPrindeBoss[ playerid ] = 30; PauzaPeste[ playerid ] = repeat CooldownPeste( playerid ); return 1; } timer CooldownPeste[ 1000 ]( playerid ){ PotPrindeBoss[ playerid ] --; if( PotPrindeBoss[ playerid ] == 0 ){ stop PauzaPeste[ playerid ]; SendClientMessage( playerid, -1, "Acum poti prinde un nou peste." ); } return 1; } Dar daca nu o ai, poti incerca asta: new PotPrindeBoss[ MAX_PLAYERS ]; public OnPlayerConnect( playerid ){ PotPrindeBoss[ playerid ] = 0; return 1; } CMD:fish( playerid, params[ ] ){ if( PotPrindeBoss[ playerid ] == 1 )return SendClientMessage( playerid, -1, "Poti folosi comanda asta dupa 30 de secunde de la ultimul peste prins." ); /* bla...bla...bla ce ai tu pe aici */ PotPrindeBoss[ playerid ] = 1; SetTimerEx( "CooldownPeste", 30000, false, "d", playerid ); return 1; } forward CooldownPeste( playerid ); public CooldownPeste( playerid ){ PotPrindeBoss[ playerid ] = 0; SendClientMessage( playerid, -1, "Acum poti prinde un nou peste." ); return 1; } Mentionez ca n-am compilat pe nici una dintre ele, daca ai vreo eroare/warning anunta-ma.
  3. Username: Buha Nume gamemode: Base Scuby-Doo Creator (sau editor): Buha Poze/Video în care prezinţi modul de joc: https://imgur.com/a/MkbeZVW Link Virustotal: https://www.virustotal.com/#/file/64e818c3f4cf93cfa076a9022de796aa7a75837e488e765b4c48b818816096b3/detection Link download: [Protected content] Alte precizări: Ar cam fii ceva... In primul rand trebuie sa adaugati o protectie anti mysql injection ( mie mi-a fost al dracu de lene, chiar daca dureaza 3 minute ) si in rest o gasiti cateva sfaturi intr-un fisier .txt in folder-ul cu gamemode-ul. Apropo, nu ofer support pentru acest GM ! Deoarece este cat se poate de simplu iar daca vreti sa intelegeti cum functioneaza ORM puteti sa cititi si voi documentatia, dar in principal nu mai trebuie sa actualizati datele prin mysql_query/mysql_tquery/mysql_pquery ( cel putin in cazul playerilor, unde datele sunt salvate la OnPlayerDisconnect ). Desigur, daca doriti puteti folosi metoda asta la anumite sisteme, nu afecteaza cu nimic.
  4. CMD:uratii( playerid, params [ ] ) { if( PlayerInfo[ playerid ][ pAdmin ] <= 4 )return 0; new query[ 56 ]; mysql_format( SQL, query, sizeof query, "SELECT * FROM `urat`" ); mysql_tquery( SQL, query, "GetUrati", "d", playerid ); return 1; } function GetUrati( playerid ) { if( cache_get_row_count( ) == 0 )return SendClientMessage( playerid, -1, "No result found." ); new ID, playerNick[ MAX_PLAYER_NAME ], ID_joc, dialog_text[ 512 ], one_row[ 56 ]; for( new i = 0; i < cache_num_rows( ); i++ ){ ID = cache_get_field_content_int( i, "id" ); cache_get_field_content( i, "NUME", playerNick ); ID_joc = cache_get_field_content_int( i, "IDJOC" ); format( one_row, sizeof one_row, "%d -> %s -> %d\n", ID, playerNick, ID_joc ); strcat( dialog_text, one_row ); } ShowPlayerDialog( playerid, 0, DIALOG_STYLE_MSGBOX, "Urati:", dialog_text, "Close", "" ); return 1; } Daca primesti vreo eroare/warning sa-mi spui, nu am apucat sa compilez codul. Ar trebuii sa mearga bine.
×
×
  • Create New...