GEORGIKAA Posted November 1, 2020 Report Share Posted November 1, 2020 (edited) cum pot muta task-u asta pe function? sunt incepator. in include-ul respectiv se foloseste de ysi, eu nu ma folosesc si nu vreau sa-l bag. nu stiu in ce pot schimba acel (2000) sau cum transform asta in functie. task teamStart(2000) { for(new i; i < 6; i++) { if(startMatchTime[i] != 1) startMatchTime[i]-= 2; if(startMatchTime[i] < 3) { startMatchTime[i] = 1; foreach(new x : Player) { if(teamPlacedBet[x] != i) { resetTeamTimer(i); } } } } return 1; } Edited November 1, 2020 by GEORGIKAA Quote Link to comment Share on other sites More sharing options...
0 Uzzi25, Posted November 1, 2020 Report Share Posted November 1, 2020 (edited) Poti cauta pe google chiar daca nu mai exista wiki samp BASIC SA-MP & PAWN GUIDE https://www.burgershot.gg/showthread.php?tid=738 Edited November 1, 2020 by Uzzi25 grx Quote Link to comment Share on other sites More sharing options...
0 GEORGIKAA Posted November 1, 2020 Author Report Share Posted November 1, 2020 nu inteleg ce ar trebui sa ii fac in cazul prezentat de mine. Quote Link to comment Share on other sites More sharing options...
0 Uzzi25, Posted November 1, 2020 Report Share Posted November 1, 2020 In primul rand ai gresit categoria in al doilea ai un exemplu de functie aici (eu unul nu iti fac functia) function RespawnVehicle(fid) { for(new i; i < MAX_SVEHICLES; i++) { if(ServerVehicles[i][vFaction] == fid) { SetVehicleVirtualWorld(i, 0); SetVehicleToRespawn(i); } } return 1; } Quote Link to comment Share on other sites More sharing options...
0 GEORGIKAA Posted November 2, 2020 Author Report Share Posted November 2, 2020 acum am vazut ca am gresit sectiunea, scuze. nu inteleg din toata functia asta ce ar trebui sa fac cu acel [2000] Quote Link to comment Share on other sites More sharing options...
0 shane Posted November 2, 2020 Report Share Posted November 2, 2020 Salut @GEORGIKAA, Acel task resprezinta un timer al librariei YSI, daca ai libraria YSI in gamemode si desigur, ai inclus include-ul Y_Timers la inceputul gamemodeului (#include), iti recomand sa il lasi asa. In primul rand, acel "2000" semnifica numarul de milisecunde in care sa se apeleze taskul respectiv (sau functia daca vrei sa-i spui asa). Idee e ca nu ai trecut bine acel "2000" in task, pentru ca nu se scrie cu paranteze rotunde, ci cu paranteze patrate, iar dupa acela se mai adauga inca odata paranteze rotunde care semnifica locul in care poti adauga anumiti parametri. Exemplu de task corect: task teamStart[ 2000 ]( ) Daca nu ai Y_Timers, si primesti erori cand compilezi, erori cu legatura la linia asta de la task, atunci va trebui sa te folosesti de sistemul clasic, care arata in felul urmator: La OnGameModeInit, la sfarsit, vei adauga urmatoarea linie -> SetTimer( "teamStart", 2000, true ); "teamStart" = numele functiei "2000" = sa se apeleze la 2 secunde (doar ca se scrie in milisecunde in script), eventual poti scrie 1000 * 2 (adica 2 secunde) "true" = daca sa se repete timerul sau nu (mai exista varianta "false", care inseamna ca nu se repeta). Apoi, vei crea functia foarte simplu: function teamStart() { //restul de cod din scriptul tau return true; } Quote Daca te-am ajutat => Link to comment Share on other sites More sharing options...
Question
GEORGIKAA
cum pot muta task-u asta pe function?
sunt incepator. in include-ul respectiv se foloseste de ysi, eu nu ma folosesc si nu vreau sa-l bag.
nu stiu in ce pot schimba acel (2000) sau cum transform asta in functie.
task teamStart(2000) { for(new i; i < 6; i++) { if(startMatchTime[i] != 1) startMatchTime[i]-= 2; if(startMatchTime[i] < 3) { startMatchTime[i] = 1; foreach(new x : Player) { if(teamPlacedBet[x] != i) { resetTeamTimer(i); } } } } return 1; }
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.