05.11.2013, 18:44
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!
This can be placed wherever you feel like, under a command maybe? I would reccomend to place it at OnPlayerConnect.
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.
}
}