User
Pass
2FA
 
 

amx_lastip

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Tutorials
Author Message4557
banditu

[Mentally Stable]



Status: Offline
(since 29-05-2021 22:54)
Joined: 21 Nov 2006
Posts: 349, Topics: 106
Location: Romania

Reputation: 548.9
Votes: 9

Post Posted: 16-05-2009, 20:51:39 | Translate post to: ... (Click for more languages)

Am si eu o problema am un plugin amx_lastip dar nu merge accesul amx-ului adica adminilor care sa foloseasca comanda. Comanda pe care o poate folosi oricine intra pe server nu stiu ce are ceva este in neregula cu acest plugin mai jos aveti pluginul:

Code:
#include <amxmodx>
   #include <amxmisc>
 
   #define PLUGIN "Last IP"
   #define VERSION "1.0"
   #define AUTHOR "Alka"
 
   #define STR_LEN 32
   enum _:Infos
   {
     
      gUserIp[STR_LEN],
      gUserName[STR_LEN]
   }
 
   new gLastUsers[5][Infos];
   public plugin_init() {
      register_plugin(PLUGIN, VERSION, AUTHOR)
      register_concmd("amx_lastip", "cmdLastIp", ADMIN_KICK, "");
     
   }
   public cmdLastIp(id,level,cid)
   {
          if(!gLastUsers[0][gUserName][0]) {
       
                 client_print(id,3,"Inca nu a iesit nici un jucator de pe server!");
                 return 1;
          }
     
          for(new i = 0;i < 5;i++)
       {
                 if(!gLastUsers[i][gUserName][0] || ! gLastUsers[i][gUserIp][0])
                    continue;
                 console_print(id,"%s   -   %s",gLastUsers[i][gUserName], gLastUsers[i][gUserIp]);
          }
     
          return 1;
     
   }
   public client_disconnect(id)
   {
          static sName[32];
          get_user_name(id,sName,sizeof sName - 1);
          for(new i = 0;i < sizeof gLastUsers;i++)
       {
       
                 if(equali(gLastUsers[i][gUserName],sName))
                    return 1;
          }
     
          static iNum;
          get_user_name(id,gLastUsers[iNum][gUserName],STR_LEN - 1);
          get_user_ip(id,gLastUsers[iNum][gUserIp],STR_LEN - 1, 1);
          iNum++;
     
          if(iNum >= 5)
                 iNum = 0;
       
          return 0;
     
   }

0 0
  
Back to top
View user's profile Send private message
Shocker

[Freakz owner]



Status: Offline
(since 08-02-2020 12:17)
Joined: Momentul zero
Posts: 33986, Topics: 1350
Location: localhost

Reputation: 6485.6
Votes: 829

   
Post Posted: 16-05-2009, 21:38:21 | Translate post to: ... (Click for more languages)

Nu se prea intelege ce spui tu acolo, ce nu merge mai exact?

FREAKZ COMMUNITY @ Facebook
WOW FREAKZ @ Facebook
0 0
  
Back to top
View user's profile Send private message
banditu

[Mentally Stable]



Status: Offline
(since 29-05-2021 22:54)
Joined: 21 Nov 2006
Posts: 349, Topics: 106
Location: Romania

Reputation: 548.9
Votes: 9

Post Posted: 16-05-2009, 21:48:00 | Translate post to: ... (Click for more languages)

Deci sa explic mai bine. Acesta comanda ar trebui sa fie accesibila decat si numai adminilor cu acces de ADMIN_KICK, pe cand aceasta comanda o poate folosi orice jucator ceea ce nu vreau - si nu stiu exact ce anume este gresit in plugin vreo linie etc
0 0
  
Back to top
View user's profile Send private message
FireLord

[rasterizer;w0w]



Status: Offline
(since 28-10-2016 23:32)
Joined: 01 Aug 2007
Posts: 2340, Topics: 94
Location: Romania

Reputation: 335.9
Votes: 51

 
Post Posted: 16-05-2009, 22:33:40 | Translate post to: ... (Click for more languages)

Adica vrea sa stie cum sa faca sa aiba acces la acea comanda , numai admini care au acces peste admin_kick -
0 0
  
Back to top
View user's profile Send private message
nr913
[Banned user]


Banned


Status: Offline
(since 24-10-2013 10:06)
Joined: 24 Apr 2009
Posts: 4224, Topics: 223
Location: România

Reputation: 60.3
Votes: 156

 
Post Posted: 16-05-2009, 22:38:33 | Translate post to: ... (Click for more languages)

Code:
   public cmdLastIp(id,level,cid)
   {
       [b]if ( ! cmd_access ( id , level , cid , 1 ) )
           return PLUGIN_HANDLED[/b]
...
[/code]

0 0
  
Back to top
View user's profile Send private message
banditu

[Mentally Stable]



Status: Offline
(since 29-05-2021 22:54)
Joined: 21 Nov 2006
Posts: 349, Topics: 106
Location: Romania

Reputation: 548.9
Votes: 9

Post Posted: 16-05-2009, 22:47:14 | Translate post to: ... (Click for more languages)

@firelord - Da cei cu acces de kick sau ce acces ii pun eu pluginului.
@nr913 - Daca ai putea imi introduci exact codul in plugin si sa il postezi cu totul decat sa ramana sa il compilez ar fi super nu prea ma pricep ms

EDIT: Gata am rezolvat ms - pluginul este asa sper ca este corect:

Quote:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Last IP"
#define VERSION "1.0"
#define AUTHOR "Alka"

#define STR_LEN 32
enum _:Infos
{

gUserIp[STR_LEN],
gUserName[STR_LEN]
}

new gLastUsers[5][Infos];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_lastip", "cmdLastIp", ADMIN_ADMIN, "");

}
public cmdLastIp(id,level,cid)
{

if ( ! cmd_access ( id , level , cid , 1 ) )
return PLUGIN_HANDLED

if(!gLastUsers[0][gUserName][0]) {

client_print(id,3,"Inca nu a iesit nici un jucator de pe server!");
return 1;
}

for(new i = 0;i < 5;i++)
{
if(!gLastUsers[i][gUserName][0] || ! gLastUsers[i][gUserIp][0])
continue;
console_print(id,"%s - %s",gLastUsers[i][gUserName], gLastUsers[i][gUserIp]);
}

return 1;

}
public client_disconnect(id)
{
static sName[32];
get_user_name(id,sName,sizeof sName - 1);
for(new i = 0;i < sizeof gLastUsers;i++)
{

if(equali(gLastUsers[i][gUserName],sName))
return 1;
}

static iNum;
get_user_name(id,gLastUsers[iNum][gUserName],STR_LEN - 1);
get_user_ip(id,gLastUsers[iNum][gUserIp],STR_LEN - 1, 1);
iNum++;

if(iNum >= 5)
iNum = 0;

return 0;

}

0 0
  
Back to top
View user's profile Send private message
nr913
[Banned user]


Banned


Status: Offline
(since 24-10-2013 10:06)
Joined: 24 Apr 2009
Posts: 4224, Topics: 223
Location: România

Reputation: 60.3
Votes: 156

 
Post Posted: 18-05-2009, 23:47:38 | Translate post to: ... (Click for more languages)

Este corect. Compileaza-l si zi-ne daca mai intampini ceva erori.
0 0
  
Back to top
View user's profile Send private message
banditu

[Mentally Stable]



Status: Offline
(since 29-05-2021 22:54)
Joined: 21 Nov 2006
Posts: 349, Topics: 106
Location: Romania

Reputation: 548.9
Votes: 9

Post Posted: 19-05-2009, 13:04:27 | Translate post to: ... (Click for more languages)

Merge f bine acum ms toturor -
0 0
  
Back to top
View user's profile Send private message
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Tutorials  


The time now is 27-04-2024, 12:50:49
Copyright info

Based on phpBB ro/com
B

 
 
 







I forgot my password


This message appears only once, so
like us now until it's too late ! :D
x