[Tutorial] How to detect an IP, and make the account admin.
#1

NOTE: Do not use this at a network with multiple people playing samp.

So, I've seen allot of people having trouble with this, so i thought lets make my first tutorial ^^. It's small and simple!

pawn Код:
if(PlayerInfo[playerid][pAdmin] <= 0) // pAdmin = the admin variable, detects if the player already is admin.
{
    new root[16]; // Creating the root variable
    GetPlayerIp(playerid, root, sizeof(root)); // Here it gets the player his ip, and stores it as "root"
    if(!strcmp(root, "127.0.0.1")) // Here it compares the player IP with the IP: 127.0.0.1(localhost), and if it is correct, it redirects, if not, it skips.
    {
        PlayerInfo[playerid][pAdmin] = 6; // Here it will set the admin level of the player.
        SendClientMessage(playerid, -1, "Hi there server owner, your admin level has been set to 6!"); // and now we send the player a message.
    }
}
This can be placed wherever you feel like, under a command maybe? I would reccomend to place it at OnPlayerConnect.
Reply


Messages In This Thread
How to detect an IP, and make the account admin. - by ThaCrypte - 05.11.2013, 18:44
Re: How to detect an IP, and make the account admin. - by Beaner - 06.11.2013, 16:29
Re: How to detect an IP, and make the account admin. - by Wizzy951 - 06.11.2013, 16:31
Re: How to detect an IP, and make the account admin. - by Khanz - 06.11.2013, 16:40

Forum Jump:


Users browsing this thread: 1 Guest(s)