TheGodfather Posted May 11, 2021 Report Share Posted May 11, 2021 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. Quote Link to comment Share on other sites More sharing options...
0 iSkull Posted May 11, 2021 Report Share Posted May 11, 2021 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 Quote Link to comment Share on other sites More sharing options...
0 TheGodfather Posted May 11, 2021 Author Report Share Posted May 11, 2021 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. Quote Link to comment Share on other sites More sharing options...
0 TheGodfather Posted May 11, 2021 Author Report Share Posted May 11, 2021 Asta am primit dupa ce am dat /relog, nu a mers Quote Link to comment Share on other sites More sharing options...
0 iSkull Posted May 11, 2021 Report Share Posted May 11, 2021 Ti-a aparut dialogul pentru logare? Quote Link to comment Share on other sites More sharing options...
0 TheGodfather Posted May 11, 2021 Author Report Share Posted May 11, 2021 Acum 2 minute, iSkull a spus: Ti-a aparut dialogul pentru logare? Da, a aparut dar mi-a dat kick instant Quote Link to comment Share on other sites More sharing options...
0 iSkull Posted May 11, 2021 Report Share Posted May 11, 2021 Arata functia de delay pentru acel kick Quote Link to comment Share on other sites More sharing options...
0 TheGodfather Posted May 11, 2021 Author Report Share Posted May 11, 2021 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; } Quote Link to comment Share on other sites More sharing options...
0 TheGodfather Posted May 11, 2021 Author Report Share Posted May 11, 2021 #define KickEx(%1) SetTimerEx ( "Kick_Ban", 500, false, "ii", %1, false ) Quote Link to comment Share on other sites More sharing options...
0 iSkull Posted May 11, 2021 Report Share Posted May 11, 2021 Sa inteleg ca e la spawnare sau unde? Quote Link to comment Share on other sites More sharing options...
0 TheGodfather Posted May 11, 2021 Author Report Share Posted May 11, 2021 Chiar acum, iSkull a spus: Sa inteleg ca e la spawnare sau unde? La OnPlayerSpawn este. Quote Link to comment Share on other sites More sharing options...
0 iSkull Posted May 11, 2021 Report Share Posted May 11, 2021 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); } Quote Link to comment Share on other sites More sharing options...
0 TheGodfather Posted May 11, 2021 Author Report Share Posted May 11, 2021 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 Quote Link to comment Share on other sites More sharing options...
0 TheGodfather Posted May 11, 2021 Author Report Share Posted May 11, 2021 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. Quote Link to comment Share on other sites More sharing options...
0 iSkull Posted May 11, 2021 Report Share Posted May 11, 2021 E posibil din cauza ca ai pus utilizatorul ca si conectat desi nu este, e posibil pusa o conditie la acele butoane Quote Link to comment Share on other sites More sharing options...
0 TheGodfather Posted December 9, 2021 Author Report Share Posted December 9, 2021 up Quote Link to comment Share on other sites More sharing options...
0 Banditul Posted December 9, 2021 Report Share Posted December 9, 2021 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% Quote Link to comment Share on other sites More sharing options...
0 TheGodfather Posted December 9, 2021 Author Report Share Posted December 9, 2021 (edited) 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 December 9, 2021 by TheGodfather Quote Link to comment Share on other sites More sharing options...
0 TheGodfather Posted December 10, 2021 Author Report Share Posted December 10, 2021 up Quote Link to comment Share on other sites More sharing options...
Question
TheGodfather
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 comment
Share on other sites
18 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.