vip don't save
#1

http://pastebin.com/bfUMhDex
i have this plugin.
i give vip to player and after i restart server, vip don t save..
Reply
#2

Create a folder in scriptfiles called "Users".
Reply
#3

Код HTML:
public OnPlayerConnect(playerid)
{
    new string[200];
        format(string, sizeof(string), " Welcome Back %s  Your Vip Level is: %d", PlayerName(playerid), Vip[playerid] );
        SendClientMessage(playerid ,COLOR_RED, string);
    tune[playerid] = 0;
    asked1[playerid] = 0;
        asked[playerid] = 0;
        ship[playerid] = 0;
        SendClientMessage(playerid,-1,"RPG.KRONDZ.COM");
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"VIP",0);
    INI_Close(File);
    return 1;
}
Replace in

Код HTML:
public OnPlayerConnect(playerid)
{
    new string[128];
    
    format(string, sizeof(string), " Welcome Back %s  Your Vip Level is: %d", PlayerName(playerid), Vip[playerid]);
    SendClientMessage(playerid ,COLOR_RED, string);

    tune[playerid] = 0;
    asked1[playerid] = 0;
    asked[playerid] = 0;
    ship[playerid] = 0;

    SendClientMessage(playerid,-1,"RPG.KRONDZ.COM");

    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;
}
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)