Jump to content

Securitate RPG


rfx

Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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!

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
Reply to this topic...

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