Jump to content

Recommended Posts

Posted

Am o securitate in GM, care nu lasa playerii sa faca diferite actiuni daca s-au logat de pe alte IP-uri. https://pastebin.com/20w2cbdV , sunt consitent ca as putea sa schimb la if(PlayerInfo[playerid][pLevel] > 4)  sa pun un nivel imposibil de ajuns decat cu comanda [/set] sau sa schimb din PlayerInfo[playerid][pBlockedAcc] = 1; in valoarea 0, eu as vrea sa imi spuneti unde gasesce acel timp de asteptare (72 ore) pentru al modifica in minim 2 - 3 - 4 ore.

Posted (edited)

Randul 75 in pastebin-ul tau.

gettime() => reprezinta timpul in meotada UNIX anume secundele trecute din anul 1970 pana in prezent.

(gettime() + 3*86400) => unix time din momentul acela + 3*86400

3*86400=259200/3600=72 de ore

poti inlocui formula cu

gettime()+3600*2 // Anume trebuie sa satept 2 ore si sa dea un relog, daca vrei 3 ore inlocuiesti 3600*3

 

Edited by ScriptarFals
Posted

pui asta la onplayerconnect   si onplayerlogin

 

    if(NumIp(playerip, playerid) >= 3 && !IsBotOnIP(playerip))
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "There are already 2 players connected with same IP.");
         KickEx(playerid);
         return 1;
    }

 

 

function NumIp(ip[], playerid)
{
     new ips = 0;
      foreach(new i : Player)
     {
          if(i == playerid) continue;
          new playerip[16];
          GetPlayerIp(i,playerip,sizeof(playerip));
        if(strmatch(ip, playerip)) ips++;
     }
     return ips;
}

 

si aia

 

 

Posted
1 hour ago, ScriptarFals said:

Randul 75 in pastebin-ul tau.

gettime() => reprezinta timpul in meotada UNIX anume secundele trecute din anul 1970 pana in prezent.

(gettime() + 3*86400) => unix time din momentul acela + 3*86400

3*86400=259200/3600=72 de ore

poti inlocui formula cu


gettime()+3600*2 // Anume trebuie sa satept 2 ore si sa dea un relog, daca vrei 3 ore inlocuiesti 3600*3

 

Multumesc frumos!

Posted
16 minutes ago, Iobit said:

pui asta la onplayerconnect   si onplayerlogin

 

    if(NumIp(playerip, playerid) >= 3 && !IsBotOnIP(playerip))
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "There are already 2 players connected with same IP.");
         KickEx(playerid);
         return 1;
    }

 

 

function NumIp(ip[], playerid)
{
     new ips = 0;
      foreach(new i : Player)
     {
          if(i == playerid) continue;
          new playerip[16];
          GetPlayerIp(i,playerip,sizeof(playerip));
        if(strmatch(ip, playerip)) ips++;
     }
     return ips;
}

 

si aia

 

 

Mersi frumos si tie, varianta lui @scripterfals m-a ajutat. Dar oricum, multumesc!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.