Sari la conținut

Tabel Lideri

Conținut Popular

Afișez conținut cu cea mai mare reputație pe 11.09.2016 în toate secțiunile

  1. No, salutare ! Astazi o sa va invat cum sa restrictionati logarea RCON doar pentru dumneavoastra..<> Deci, intai trebuie sa facem un stock numit strmatch: stock strmatch(const String1[], const String2[]) { if ((strcmp(String1, String2, true, strlen(String2)) == 0) && (strlen(String2) == strlen(String1))) return true; else return false; } Acum, adaugam functia GetPlayerID: forward GetPlayerID(ip[]); public GetPlayerID(ip[]) { new ips[16]; for(new i=0;i< MAX_PLAYERS;i++) { if(IsPlayerConnected(i)) { GetPlayerIp(i, ips, sizeof(ips)); if(strmatch(ip, ips)) return i; } } } Iar acum modificam aceasta functie: public OnRconLoginAttempt(ip[], password[], success) { new playerid = GetPlayerID(ip); if(success == 1) { GetPlayerName(playerid, pName, sizeof(pName)); if(strmatch(pName, "NUMELE_TAU")) { return 1; } else { Ban(playerid); } } return 1; } Tin sa precizez ca sunt cam ruginit la cod..nu sunt sigur daca va merge..
    1 punct
  2. 1 punct
×
×
  • Creează nouă...