Jump to content
  • 0

Comanda de relog


TheGodfather

Question

18 answers to this question

Recommended Posts

  • 0

Ai putea face oarecum asa: 

CMD:relog(playerid, params[])
{
	SendClientMessage(playerid, -1, "In curand te vei reconecta!");
	OnPlayerConnect(playerid);
	return 1;
}

Nu sunt sigur ca va functiona, daca vrei ceva global, exemplu pentru actualizarea gm-ului, te poti conecta tu la rcon si dupa apelezi gmx pentru restart

Link to comment
Share on other sites

  • 0
Acum 1 minut, iSkull a spus:

Ai putea face oarecum asa: 

CMD:relog(playerid, params[])
{
	SendClientMessage(playerid, -1, "In curand te vei reconecta!");
	OnPlayerConnect(playerid);
	return 1;
}

Nu sunt sigur ca va functiona, daca vrei ceva global, exemplu pentru actualizarea gm-ului, te poti conecta tu la rcon si dupa apelezi gmx pentru restart

Incerc acum.

Link to comment
Share on other sites

  • 0

Mai bine fa-l timer, timp de asteptare 30 de secunde sau cat doresti, altfel nu ai cum sa treci din cauza ca la conectare sunt resetate majoritatea, dar trebuie sa ai grija sa-l faci pe baza de id la timer

 

Ex:

new LoginTimer[MAX_PLAYERS];

OnPlayerConnect(playerid)
{
	LoginTimer[playerid] = SetTimerEx("Delay", 30000, false, "i", playerid);
	ShowPlayerDialog// pentru conectare
}

OnDialogResponse => daca user-ul introduce corect parola si exista in baza de date sa-l pui LoginTimer[playerid] = -1;

function Delay(playerid)
{
	if(LoginTimer[playerid] == -1) return 1;
	SendClientMessage(playerid, -1, "Ai primit kick deoarece nu te-ai logat in 30 de secunde!");
	KillTimer(LoginTimer[playerid]);
	LoginTimer[playerid] = -1;
	Kick(playerid);
}

 

Link to comment
Share on other sites

  • 0
Acum 2 minute, iSkull a spus:

Mai bine fa-l timer, timp de asteptare 30 de secunde sau cat doresti, altfel nu ai cum sa treci din cauza ca la conectare sunt resetate majoritatea, dar trebuie sa ai grija sa-l faci pe baza de id la timer

 

Ex:

new LoginTimer[MAX_PLAYERS];

OnPlayerConnect(playerid)
{
	LoginTimer[playerid] = SetTimerEx("Delay", 30000, false, "i", playerid);
	ShowPlayerDialog// pentru conectare
}

OnDialogResponse => daca user-ul introduce corect parola si exista in baza de date sa-l pui LoginTimer[playerid] = -1;

function Delay(playerid)
{
	if(LoginTimer[playerid] == -1) return 1;
	SendClientMessage(playerid, -1, "Ai primit kick deoarece nu te-ai logat in 30 de secunde!");
	KillTimer(LoginTimer[playerid]);
	LoginTimer[playerid] = -1;
	Kick(playerid);
}

 

Ok, multumesc pentru raspuns :D

Link to comment
Share on other sites

  • 0

Am scris asa:

YCMD:relog(playerid, params[], help)
{
    SCM(playerid, -1, "In curand te vei reconecta!");
    OnPlayerDisconnect(playerid);
    OnPlayerConnect(playerid);
    IsPlayerLogged[playerid] = 1;
    return 1;
}

Nu imi mai da kick dar cand ma pune sa scriu pinul nu imi apar cifrele.image.png.388d3e5d738c7d45c2a2b6b3468779ca.png

Link to comment
Share on other sites

  • 0

Nu stiu daca mai functioneaza sau functiona dar poti incerca sa banezi ip playerului si sa il debanezi (aici ma refer la comanda de rcon)

new string[50], playerIp[17];
GetPlayerIp(playerid, playerIp);
format(string, sizeof(string), "banip %s", playerIp);
SendRconCommand(string);
format(string, sizeof(string), "unbanip %s", playerIp);
SendRconCommand(string);
SendRconCommand("reloadbans"); // eventual pentru siguranta ca fim siguri ca nu mai este banat

Stiu ca asta genera un timeout si ii dadea kick dupa care il reconecta. Dar nu pot garanta 100%

Link to comment
Share on other sites

  • 0
1 hour ago, Banditul said:

Nu stiu daca mai functioneaza sau functiona dar poti incerca sa banezi ip playerului si sa il debanezi (aici ma refer la comanda de rcon)

new string[50], playerIp[17];
GetPlayerIp(playerid, playerIp);
format(string, sizeof(string), "banip %s", playerIp);
SendRconCommand(string);
format(string, sizeof(string), "unbanip %s", playerIp);
SendRconCommand(string);
SendRconCommand("reloadbans"); // eventual pentru siguranta ca fim siguri ca nu mai este banat

Stiu ca asta genera un timeout si ii dadea kick dupa care il reconecta. Dar nu pot garanta 100%

Am incercat pe localhost si si pe server dar nu face nimic din pacate.

Edited by TheGodfather
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
Answer this question...

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