vip don't save
#4

You can't directly check a player his VIP level once he connects, if I'm correct it keeps showing that the player has vip level 0 when he connects, right?

Try this;

Код:
// along with all other variables;
new vipchecker[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
	vipchecker[playerid] = -1;
	vipchecker[playerid] = SetTimerEx("VipCheckMessage", 2000, false, "i", playerid);
	if(!fexist(UserPath(playerid))
	{
		new INI:File = INI_Open(UserPath(playerid));
		INI_SetTag(File,"data");
		
		INI_WriteInt(File, "VIP", 0);
		INI_Close(File);
	}
	else INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
		
	return 1;
}

forward VipCheckMessge(playerid); public VipCheckMessage(playerid)
{
	if(IsPlayerConnected(playerid) && Vip[playerid] > 0)
	{
		new string[90];
		format(string, sizeof(string), " Welcome back, %s. Your V.I.P. level is: %d", PlayerName(playerid), Vip[playerid]);
		SendClientMessage(playerid ,COLOR_RED, string);
	}
	else return 1;
	return 1;
}
Reply


Messages In This Thread
vip don't save - by RedRo - 20.07.2015, 16:22
Re: vip don't save - by Moudix - 20.07.2015, 16:30
Re: vip don't save - by Mariciuc223 - 20.07.2015, 17:21
Re: vip don't save - by JaydenJason - 20.07.2015, 18:00

Forum Jump:


Users browsing this thread: 2 Guest(s)