Jump to content
  • 0

Question

Salut, aveti idee cum pot face o comanda prin care playerii sa se poata reconecta pe server fara sa inchida sampul? Gen sa dea /relog si sa le incarce din nou toate datele, sa puna din nou parola etc.

Link to post
Share on other sites

14 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 post
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 post
Share on other sites
  • 0

Nu am o functie de deelay, am doar asta:

if(IsPlayerLogged[playerid] == 0) {
        SCM(playerid, COLOR_WARNING, "* Ai primit kick deoarece nu te-ai logat.");
        KickEx(playerid);
        return true;
     }    

Link to post
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 post
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 post
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 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
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.

  • Recently Browsing   0 members

    No registered users viewing this page.

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