Save administration level
#1

How can I create a save path for admins level as I have it in the enum pinfo but it's not saving it in the users file
Reply
#2

Help please
Reply
#3

Which saving system do you use?
Reply
#4

"users file", gonna guess it's Y_INI

Post the saving snippet.
Reply
#5

Код:
 dini_IntSet(file, "Level",PlayerInfo[playerid][pAdminLevel]);
Thats the line i have just added into onplayerdisconnect
and onplayer connect which has started showing the admin level in the dini user file but when i log into the game its not loading that file for some reason

Is there a way i can change how often it saves a users file?
Reply
#6

Okay turns out none of the stats are saving and not the last position you was at when you log
Reply
#7

help
Reply
#8

If its not loading so thats mean theres something wrong under your OnPlayerConnect
Reply
#9

Код:
public OnPlayerConnect(playerid)
{
    gPlayerLogged[playerid] = 0;
    SetPlayerColor(playerid, COLOR_WHITE);
	TogglePlayerSpectating(playerid, true);
	new playername[MAX_PLAYER_NAME], file[256];
	GetPlayerName(playerid, playername, sizeof(playername));
	format(file, sizeof(file), SERVER_USER_FILE, playername);
	SendClientMessage(playerid, COLOR_WHITE, "Welcome To Inter City Roleplay");
	SendClientMessage(playerid, COLOR_BLUE, "Our Anti-Cheat will catch you, so do not try hacking");
	SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
	SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
    if(fexist(file))
    {
        PlayerInfo[playerid][pRegistered] = dini_Int(file, "Registered");
        PlayerInfo[playerid][pMoney] = dini_Int(file, "Money");
        PlayerInfo[playerid][pSkin] = dini_Int(file, "Skin");
        PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "Level");
        PlayerInfo[playerid][pJailTime] = dini_Int(file, "JailTime");
		PlayerInfo[playerid][pHealth] = dini_Float(file, "Health");
		PlayerInfo[playerid][pArmour] = dini_Float(file, "Armour");
        PlayerInfo[playerid][pPhone] = dini_Int(file, "Phone");
        PlayerInfo[playerid][pBank] = dini_Int(file, "Bank");
        AdminDuty[playerid] = 0;
        SetTimerEx("TrashTimer", 1500000, 1, "i", playerid);
		JackingCar[playerid] = 0;
		Logging[playerid] = 0;
		GettingJob[playerid] = 0;
  		Farming[playerid] = 0;
    	PlantingSeeds[playerid] = 0;
	    GrowingCrops[playerid] = 0;
		FarmingCrops[playerid] = -1;
        CollectingTrash[playerid] = 0;
        CollectingTrash1[playerid] = 0;
        CollectingTrash2[playerid] = 0;
        CollectingTrash3[playerid] = 0;
        CollectingTrash4[playerid] = 0;
        CollectingTrash5[playerid] = 0;
        CollectingTrash6[playerid] = 0;
        CollectingTrash7[playerid] = 0;
        CollectingTrash8[playerid] = 0;
        CollectingTrash9[playerid] = 0;
        CollectingTrash10[playerid] = 0;
        CollectingTrash11[playerid] = 0;
        CollectingTrash12[playerid] = 0;
        CollectingTrash13[playerid] = 0;
		oldcar[playerid] = 0;
		HandsupPlayer[playerid] = 0;
		EatingFood[playerid] = 0;
		DeliveryTruck[playerid] = 0;
		PlayerTied[playerid] = 0;
		ShotPlayer[playerid] = 0;
		SmuggleDropOff[playerid] = 0;
		PlayerCuffed[playerid] = 0;
		CellTime[playerid] = 0;
		PlayerRestrained[playerid] = 0;
		RentedCar[playerid] = 0;
		HoldingObject[playerid] = 0;
		PhoneOnline[playerid] = 0;
		Mobile[playerid] = INVALID_PLAYER_ID;
		Spectating[playerid] = 0;
		RingTone[playerid] = 0;
		CopDuty[playerid] = 0;
		TazerCharged[playerid] = 0;
		Tazer[playerid] = 0;
		SmugglingMats[playerid] = 0;
  		SetPlayerColor(playerid, COLOR_WHITE);
        GettingPacks[playerid] = 0;
		ResetPlayerMoney(playerid);
	    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Welcome Back", " Welcome Back, This Account Is Registered \n Please Type Your Password Below To Continue: \n", "Login", "Quit");
	}
    else if (!dini_Exists(file))
    {
	    SendClientMessage(playerid, COLOR_BLUE, "       [-Fort Carson Immigration-]    ");
	    SendClientMessage(playerid, COLOR_WHITE, "      We Cannot Seem To Find A File    ");
	    SendClientMessage(playerid, COLOR_WHITE, " On You, Please Fill In This Information ");
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Welcome To Fort Carson", " Welcome, This Account Is Not Registered \n Please Type Your Desired Password Below To Continue: \n", "Register", "Cancle");
        AdminDuty[playerid] = 0;
	}
	return 1;
}
This is my onplayerconnect can anyone see why its not loading them?
Reply
#10

Any advice? Skins and player registered save but nothing else does
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)