Jump to content
Sign in to follow this  
K0hL

Restart

Recommended Posts

Salut !  Cum as putea sa fac o comanda ce se da restart la server si gamemode gen ? Pentru ca eu n am acces la dashboard si are doar un prieten care nu e activ cand vreau eu.

Daca pot face , daca ma poate ajuta cineva

Share this post


Link to post
Share on other sites
Quote
1: Daca comenzile tale sunt pe ycmd lasi ycmd, daca nu, schimba cu CMD.

Creezi variabila new  RestartTime;
2: Creezi comanda asta:
YCMD:restart(playerid, params[], help) {
	if(PlayerInfo[playerid][pAdmin] < 6) return SCM(playerid, COLOR_WHITE, AdminOnly);
	new time, string[180];
	if(sscanf(params, "i", time)) return SCM(playerid,COLOR_GREY, "{FFFF00}Syntaxa: {FFFFFF}/restart <timp in minute>");
	format(string, sizeof(string), "(( Admin %s: {FF9696}Urmeaza un restart in %d ore (%d minute). {A9C4E4}))", GetName(playerid), time/60, time);
	SCMTA(COLOR_CLIENT, string);
	RestartTime = time*60;
	return 1; }
                                        
 3.Te duci la un timer de 1000 de milisecunde din Gamemode-ul tau, poti cauta daca ai task "[1000]", si o sa te duca la timer, sau il poti gasii singur la ongamemodeinit, dupa care adaugi asta.
    new znxtext[126];                                   
    if(RestartTime >= 1) {
	    RestartTime--;
		if(RestartTime <= 60) {
			format( znxtext, sizeof(znxtext), "~w~Urmeaza un restart in~n~~r~%d secunde", RestartTime);
			GameTextForAll( znxtext, 1100, 4 );
          }
        }                    
	    if(RestartTime == 3) {
			foreach(Player, i) {
				if(IsPlayerLogged[i] == 1 && PlayerInfo[i][pAdmin] < 7) KickEx(i);
			}
		}
	    if(RestartTime == 0) GameModeExit();
	}

Sunt 99% sigur ca folosesti un gamemode tip bigzone/burned cv de la saints, asa ca nu mai are rost sa iti definesc unele functii cum ar fii AdminOnly sau IsPlayerLogged, iar daca 1% ma insel, dai un reply si ti le definesc.

Edited by zNx[]

Share this post


Link to post
Share on other sites
Acum 12 minute, K0hL a spus:

Salut !  Cum as putea sa fac o comanda ce se da restart la server si gamemode gen ? Pentru ca eu n am acces la dashboard si are doar un prieten care nu e activ cand vreau eu.

Daca pot face , daca ma poate ajuta cineva

CMD:restart(playerid, params[]) 
{
	if(PlayerInfo[playerid][pAdmin] < 6) return true;
	GameModeExit();
	return true;
}

 

  • Haha 1

YouTube : Click

Discord : CosminAK47#8524

Share this post


Link to post
Share on other sites
15 minutes ago, zNx[] said:

Sunt 99% sigur ca folosesti un gamemode tip bigzone/burned cv de la saints, asa ca nu mai are rost sa iti definesc unele functii cum ar fii AdminOnly sau IsPlayerLogged, iar daca 1% ma insel, dai un reply si ti le definesc.

image.png.7e657a9d13aed912fc01d3b4ca52ba7f.png

ce problema ar fi? adica sunt erori multe probabil si nu mi le arata , se "compileaza" instant fara sa bage si in .amx, ce i de facut?

ai discord?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

This site uses cookies. By continuing browsing, you agree to the use of this information. For more details, see Terms of Use and Privacy Policy.