Jump to content

Cerere anti afk (kick)


Reflex

Recommended Posts

Sa mor daca am inteles ... poti sa mai explici o data ? :D

Din ce am inteles,

Vrea ca adminii in loc sa primeasca kick la un anumit numar de minute setat de el,sa primeasca warn.

Ofer servicii de web designer/developer(contact me pentru portofoliu etc)

Metode de plata: Paysafecard,Skrill,PayPal,Bitcoin

Ofer si servicii de Penetration Testing.

Vand si VPN-uri. 5 euro pe luna

Skype: live:mrtunne.tkcode

Discord: https://mrtunne.info/discord

Link to comment
Share on other sites

Din ce am inteles,

Vrea ca adminii in loc sa primeasca kick la un anumit numar de minute setat de el,sa primeasca warn.

Da, asta vreau. Ca adminii la un numar de minute setate de mine, sa primeasca warn , iar playerii kick. 

Sau unde pot pune conditia daca este admin sa primeasca kick.

Edited by Reflex
Link to comment
Share on other sites

Salut pui asta la OngameModeInit

SetTimer("AfkKicked", 60000, true);// 60000 inseamna un minut, verifica din minut in minut daca cineva e afk de mai mult de 10 minute

Apoi adaugi asta pe undeva in GM-ul tau

 

forward AfkKicked();
public AfkKicked()
{
	for(new i=0; i<MAX_PLAYERS; i++)
	{
	    if(afktime[i]/60 > 10)// impartim timpul la 60 pentru a obtine minutele playerul afk, si comparam cu minutele noastra, 10 pentru 10 minute
	    {
            new KickedAfkName[40],string[145];
        	GetPlayerName(i,KickedAfkName,sizeof(KickedAfkName));
			format(string, sizeof(string), "%s[%d] a primit kick motiv: afk mai mult de 10 minute",KickedAfkName,i);
	        SendClientMessageToAll(-1,"kick pentru ca ai stat mai mult de 10 minute afk");
afktime[i] = 0; // resetam variabila in caz de orice eventualitate/problema/bug/sau daca intra un player pe acelasi id
			Kick(i);
	    }
	}
	return 1;
	
}

 

Desi este o problema, ar trebui sa ai o comanda de /afk si sa primeasca kick playerii care nu au dat /afk.

Atunci va trebui sa modifici in ceva de genul asta:

if(afktime[i]/60 > 10 && PlayerInfo[i][pAfk] == 0)

 

iar la comanda /afk ar trebui sa ai asa

PlayerInfo[playerid][pAfk] = 1;

 

 

Sper sa te ajute.

 

 

Edited by Mister
  • Upvote 1

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Am schimbat acel pAFK, cu cel care il folosesc la comanda(/afk)....nu functioneaza cum ar trebuii.

De exemplu -> Am pus:

if(afktime[i]/60 > 1

Dar am luat kick dupa 2 minute si ceva...  Nu dupa 1minut.

Asa am facut:

forward AfkKicked();
public AfkKicked()
{
	for(new i=0; i<MAX_PLAYERS; i++)
	{
	    if(afktime[i]/60 > 1 && PlayerInfo[i][AFKBRB] == 0)
	    {
            new KickedAfkName[40],string[145];
        	GetPlayerName(i,KickedAfkName,sizeof(KickedAfkName));
			format(string, sizeof(string), "%s[%d] a primit kick motiv: afk mai mult de 1 minut",KickedAfkName,i);
	        SendClientMessageToAll(-1,"kick pentru ca ai stat mai mult de 1 minut afk");
			afktime[i] = 0;
			Kick(i);
	    }
	}
	return 1;
}

Iar uneori le apar la playeri le apar random, acel TextLabel. Asta inainte sa pun acest afkkicker.

Cum pot rezolva? (Problema cu kick-ul si textlabel random..) 

Edited by Reflex
Link to comment
Share on other sites

Pune asta la onplayerpause

afktime[playerid] = 0;// pune asta inainte de timer si inainte sa se creeze labelul

Si asta la onplayerspawn 

Delete3DTextLabel(afklabel[playerid]);

 

mai mult de atat nu ai ce sa ii faci.

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
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.

×
×
  • 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.