On player connect, give player variables
#1

So I would like to give a player the pAdmin variable, which is under my enum. When the player with the name "JXF" would connect, I would like the server to give him the pAdmin variable with the level 1338. How would I manage to do that?

Here's my strcmp code:
Код:
forward NameJXF(playerid);
public NameJXF(playerid)
{
	if(IsPlayerConnected(playerid))
	{
		new nume[24];
		GetPlayerName(playerid, nume, sizeof(nume));
		if((strcmp(nume, "JXF", true) == 0))
		{
			return 1;
		}
	}
	return 0;
}
EDIT:
I have tried to do the On player connect to give player variables with SetPVarInt
This is my code:
Код:
public OnPlayerConnect(playerid) 
{ 
    if(NameJXF(playerid)) 
	{
		new string[128];
		format(string, sizeof(string), "You have been given full administrator rights, master!");
		SCM(pid, COLOR_AQUA, string);
		SetPVarInt(playerid, Player[playerid][pAdmin], 1339);
	}
IT does compile, but it doesn't work properly. What is the issue here?
P.S I have never used setpvarint ever before.
Reply


Messages In This Thread
On player connect, give player variables - by JXF - 18.06.2016, 22:02
Re: On player connect, give player variables - by MBilal - 18.06.2016, 23:34
Re: On player connect, give player variables - by JXF - 18.06.2016, 23:49
Re: On player connect, give player variables - by MBilal - 18.06.2016, 23:58
Re: On player connect, give player variables - by JXF - 19.06.2016, 00:01
Re: On player connect, give player variables - by oMa37 - 19.06.2016, 00:42
Re: On player connect, give player variables - by JXF - 19.06.2016, 02:28

Forum Jump:


Users browsing this thread: 1 Guest(s)