SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 05/12/2019, 07:16 AM   #1
zeus99
Little Clucker
 
zeus99's Avatar
 
Join Date: Jun 2019
Location: Hell
Posts: 37
Reputation: 0
Default How To Save Jail - mute - disarm - on player exit and relog

Code:
public OnFilterScriptInit()
{
	BUD::Setting(opt.Database, LOCATION_DATABASE);
	BUD::Setting(opt.KeepAliveTime, 3000);
	BUD::Initialize();

	BUD::VerifyColumn("ip", BUD::TYPE_STRING);
	BUD::VerifyColumn("joindate", BUD::TYPE_STRING);
	BUD::VerifyColumn("laston", BUD::TYPE_STRING);
	BUD::VerifyColumn("admin", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("vip", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("kills", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("deaths", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("score", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("money", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("hours", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("minutes", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("seconds", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("logged", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("autologin", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("tag", BUD::TYPE_STRING);
db_free_result(Result);
	return 1;
}
Code:
public OnPlayerConnect(playerid)
{
    if(BUD::IsNameRegistered(ReturnPlayerName(playerid)))
	{
		new userid = BUD::GetNameUID(ReturnPlayerName(playerid));
		BUD::SetIntEntry(userid, "logged", 0);
	}

	gUser[playerid][u_admin] = 0;
	SetPVarInt(playerid, "adminplayer", 0);
	gUser[playerid][u_vip] = 0;
	SetPVarInt(playerid, "vipplayer", 0);
	gUser[playerid][u_seke] = 0;
	gUser[playerid][u_kills] = 0;
	gUser[playerid][u_deaths] = 0;
	gUser[playerid][u_score] = 0;
	gUser[playerid][u_score2] = 0;
	gUser[playerid][u_money] = 0;
	gUser[playerid][u_hours] = 0;
	gUser[playerid][u_minutes] = 0;
	gUser[playerid][u_seconds] = 0;

	gUser[playerid][u_logged] = false;
	gUser[playerid][u_attempts] = 0;
	gUser[playerid][u_guest] = false;

	gUser[playerid][u_jailed] = false;
	gUser[playerid][u_jailtime] = 0;
	gUser[playerid][u_muted] = false;
	gUser[playerid][u_mutetime] = 0;
	gUser[playerid][u_cmuted] = false;
	gUser[playerid][u_cmutetime] = 0;
	gUser[playerid][u_onduty] = false;
	gUser[playerid][u_god] = false;
	gUser[playerid][u_specdata][0] = 0;
	gUser[playerid][u_specdata][1] = 0;
	gUser[playerid][u_specpos][0] = 0.0;
	gUser[playerid][u_specpos][1] = 0.0;
	gUser[playerid][u_specpos][2] = 0.0;
	gUser[playerid][u_specpos][3] = 0.0;
	gUser[playerid][u_vehicle] = -1;
	gUser[playerid][u_warnings] = 0;

	gUser[playerid][u_lastuser] = -1;
	gUser[playerid][u_nopm] = false;
	
	gUser[playerid][u_specid] = INVALID_PLAYER_ID;
	gUser[playerid][u_spec] = false;
	gUser[playerid][u_pos][0] = 0.0;
	gUser[playerid][u_pos][1] = 0.0;
	gUser[playerid][u_pos][2] = 0.0;
	gUser[playerid][u_int] = 0;
	gUser[playerid][u_vw] = 0;

	format(gUser[playerid][u_tag], 35, "NULL");

	new string[144];
	format(string, sizeof(string), "* %s[%i] Have Joined The Server!", ReturnPlayerName(playerid), playerid);
	SendClientMessageToAll(COLOR_GREY, string);
	return 1;
}
Code:
public OnPlayerDisconnect(playerid, reason)
{
GetPlayerConnectedTime(playerid, gUser[playerid][u_hours], gUser[playerid][u_minutes], gUser[playerid][u_seconds]);

			new userid = BUD::GetNameUID(ReturnPlayerName(playerid));
			BUD::SetStringEntry(userid, "ip", ReturnPlayerIP(playerid));
			BUD::SetStringEntry(userid, "laston", DATE);
			BUD::SetIntEntry(userid, "admin", gUser[playerid][u_admin]);
			BUD::SetIntEntry(userid, "vip", gUser[playerid][u_vip]);
			BUD::SetIntEntry(userid, "seke", gUser[playerid][u_seke]);
			BUD::SetIntEntry(userid, "kills", gUser[playerid][u_kills]);
			BUD::SetIntEntry(userid, "deaths", gUser[playerid][u_deaths]);
			BUD::SetIntEntry(userid, "score", GetPlayerScore(playerid));
			BUD::SetIntEntry(userid, "money", GetPlayerMoney(playerid));
			BUD::SetIntEntry(userid, "hours", gUser[playerid][u_hours]);
			BUD::SetIntEntry(userid, "minutes", gUser[playerid][u_minutes]);
			BUD::SetIntEntry(userid, "seconds", gUser[playerid][u_seconds]);
			BUD::SetIntEntry(userid, "logged", 0);
		}
	}

	gUser[playerid][u_logged] = false;
	gPlayerChatTime[playerid] = 0;
	gPlayerChat[playerid] = "";
	return 1;
}
__________________
Life doesn't get easier، you just get stronger :)
zeus99 is offline   Reply With Quote
Old 05/12/2019, 11:10 AM   #2
zeus99
Little Clucker
 
zeus99's Avatar
 
Join Date: Jun 2019
Location: Hell
Posts: 37
Reputation: 0
Default Re: How To Save Jail - mute - disarm - on player exit and relog

Please Help
__________________
Life doesn't get easier، you just get stronger :)
zeus99 is offline   Reply With Quote
Old 05/12/2019, 11:47 AM   #3
natovan
Little Clucker
 
Join Date: Nov 2019
Posts: 18
Reputation: 0
Default Re: How To Save Jail - mute - disarm - on player exit and relog

Use MySQL database.
natovan is offline   Reply With Quote
Old 05/12/2019, 12:02 PM   #4
Calisthenics
Gangsta
 
Join Date: May 2018
Posts: 877
Reputation: 156
Default Re: How To Save Jail - mute - disarm - on player exit and relog

Create new columns for mute/jail time in the database.
Update the database with the values of `gUser[playerid][u_jailtime]`, `gUser[playerid][[u_mutetime]` etc.
Load the data when logging in and check if the time is not 0 to re-mute/re-jail.
When time is up or being unmuted/unjailed by an administrator, update the database to set to 0.
Calisthenics is offline   Reply With Quote
Old 05/12/2019, 12:24 PM   #5
zeus99
Little Clucker
 
zeus99's Avatar
 
Join Date: Jun 2019
Location: Hell
Posts: 37
Reputation: 0
Default Re: How To Save Jail - mute - disarm - on player exit and relog

I have db but How to save jail time?
__________________
Life doesn't get easier، you just get stronger :)
zeus99 is offline   Reply With Quote
Old 05/12/2019, 12:45 PM   #6
Calisthenics
Gangsta
 
Join Date: May 2018
Posts: 877
Reputation: 156
Default Re: How To Save Jail - mute - disarm - on player exit and relog

The same way you save the rest of the data.
pawn Code:
// OnFilterScriptInit:
BUD::VerifyColumn("mute_time", BUD::TYPE_NUMBER, 0); // default value 0
BUD::VerifyColumn("jail_time", BUD::TYPE_NUMBER, 0); // default value 0

// OnPlayerDisconnect:
BUD::SetIntEntry(userid, "mute_time", gUser[playerid][u_mutetime]);
BUD::SetIntEntry(userid, "jail_time", gUser[playerid][u_jailtime]);
Calisthenics is offline   Reply With Quote
Old 05/12/2019, 01:50 PM   #7
zeus99
Little Clucker
 
zeus99's Avatar
 
Join Date: Jun 2019
Location: Hell
Posts: 37
Reputation: 0
Default Re: How To Save Jail - mute - disarm - on player exit and relog


Code:
public OnFilterScriptInit()
{
	BUD::Setting(opt.Database, LOCATION_DATABASE);
	BUD::Setting(opt.KeepAliveTime, 3000);
	BUD::Initialize();

	BUD::VerifyColumn("ip", BUD::TYPE_STRING);
	BUD::VerifyColumn("joindate", BUD::TYPE_STRING);
	BUD::VerifyColumn("laston", BUD::TYPE_STRING);
	BUD::VerifyColumn("admin", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("vip", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("kills", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("deaths", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("score", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("money", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("hours", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("minutes", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("seconds", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("logged", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("autologin", BUD::TYPE_NUMBER);
	BUD::VerifyColumn("tag", BUD::TYPE_STRING);
	BUD::VerifyColumn("mutetime", BUD::TYPE_NUMBER, 0); // default value 0
	BUD::VerifyColumn("cmutetime", BUD::TYPE_NUMBER, 0); // default value 0
        BUD::VerifyColumn("jailtime", BUD::TYPE_NUMBER, 0); // default value 0


        Database = db_open(LOCATION_BANS);
	Result = db_query(	Database,
						"CREATE TABLE IF NOT EXISTS `bans` \
						(`name` TEXT, \
						`ip` TEXT, \
						`banby` TEXT, \
						`banon` TEXT, \
						`reason` TEXT, \
						`expire` NUMERIC)"
					);
	        db_free_result(Result);
return 1;
}
__________________________

Code:
public OnFilterScriptExit()
{
	BUD::Exit();
	
	//close the ban database
	db_close(Database);

	return 1;
}
________________________________

Code:
public OnPlayerConnect(playerid)
{
    if(BUD::IsNameRegistered(ReturnPlayerName(playerid)))
	{
		new userid = BUD::GetNameUID(ReturnPlayerName(playerid));
		BUD::SetIntEntry(userid, "logged", 0);
	}

	gUser[playerid][u_admin] = 0;
	SetPVarInt(playerid, "adminplayer", 0);
	gUser[playerid][u_vip] = 0;
	SetPVarInt(playerid, "vipplayer", 0);
	gUser[playerid][u_seke] = 0;
	gUser[playerid][u_kills] = 0;
	gUser[playerid][u_deaths] = 0;
	gUser[playerid][u_score] = 0;
	gUser[playerid][u_score2] = 0;
	gUser[playerid][u_money] = 0;
	gUser[playerid][u_hours] = 0;
	gUser[playerid][u_minutes] = 0;
	gUser[playerid][u_seconds] = 0;

	gUser[playerid][u_logged] = false;
	gUser[playerid][u_attempts] = 0;
	gUser[playerid][u_guest] = false;

	gUser[playerid][u_jailed] = false;
	gUser[playerid][u_jailtime] = 0;
	gUser[playerid][u_muted] = false;
	gUser[playerid][u_mutetime] = 0;
	gUser[playerid][u_cmuted] = false;
	gUser[playerid][u_cmutetime] = 0;
	gUser[playerid][u_onduty] = false;
	gUser[playerid][u_god] = false;
	gUser[playerid][u_specdata][0] = 0;
	gUser[playerid][u_specdata][1] = 0;
	gUser[playerid][u_specpos][0] = 0.0;
	gUser[playerid][u_specpos][1] = 0.0;
	gUser[playerid][u_specpos][2] = 0.0;
	gUser[playerid][u_specpos][3] = 0.0;
	gUser[playerid][u_vehicle] = -1;
	gUser[playerid][u_warnings] = 0;

	gUser[playerid][u_lastuser] = -1;
	gUser[playerid][u_nopm] = false;
	
	gUser[playerid][u_specid] = INVALID_PLAYER_ID;
	gUser[playerid][u_spec] = false;
	gUser[playerid][u_pos][0] = 0.0;
	gUser[playerid][u_pos][1] = 0.0;
	gUser[playerid][u_pos][2] = 0.0;
	gUser[playerid][u_int] = 0;
	gUser[playerid][u_vw] = 0;

	format(gUser[playerid][u_tag], 35, "NULL");

	new string[144];
	format(string, sizeof(string), "* %s[%i] Joined The Server!", ReturnPlayerName(playerid), playerid);
	SendClientMessageToAll(COLOR_GREY, string);
	return 1;
}
it need change
______________________________________________


Code:
public OnPlayerDisconnect(playerid, reason)
{
if(BUD::IsNameRegistered(ReturnPlayerName(playerid)))
	{
	    if(gUser[playerid][u_logged])
	    {
	        new DATE[18], date[3];
			getdate(date[0], date[1], date[2]);
			format(DATE, sizeof(DATE), "%i/%i/%i", date[2], date[1], date[0]);

            GetPlayerConnectedTime(playerid, gUser[playerid][u_hours], gUser[playerid][u_minutes], gUser[playerid][u_seconds]);

			new userid = BUD::GetNameUID(ReturnPlayerName(playerid));
			BUD::SetStringEntry(userid, "ip", ReturnPlayerIP(playerid));
			BUD::SetStringEntry(userid, "laston", DATE);
			BUD::SetIntEntry(userid, "admin", gUser[playerid][u_admin]);
			BUD::SetIntEntry(userid, "vip", gUser[playerid][u_vip]);
			BUD::SetIntEntry(userid, "seke", gUser[playerid][u_seke]);
			BUD::SetIntEntry(userid, "kills", gUser[playerid][u_kills]);
			BUD::SetIntEntry(userid, "deaths", gUser[playerid][u_deaths]);
			BUD::SetIntEntry(userid, "score", GetPlayerScore(playerid));
			BUD::SetIntEntry(userid, "money", GetPlayerMoney(playerid));
			BUD::SetIntEntry(userid, "hours", gUser[playerid][u_hours]);
			BUD::SetIntEntry(userid, "minutes", gUser[playerid][u_minutes]);
			BUD::SetIntEntry(userid, "seconds", gUser[playerid][u_seconds]);
			BUD::SetIntEntry(userid, "jail", gUser[playerid][u_jailtime]);
			BUD::SetIntEntry(userid, "mute", gUser[playerid][u_mutetime]);
			BUD::SetIntEntry(userid, "cmute", gUser[playerid][u_cmutetime]);
			BUD::SetIntEntry(userid, "logged", 0);
		}
	}
return 1;
}
______________________________________

Code:
public OnPlayerRequestClass(playerid, classid)
{
if(	! gUser[playerid][u_logged] &&
		! gUser[playerid][u_guest])
	{
		if(BUD::IsNameRegistered(ReturnPlayerName(playerid)))
		{
		    new userid = BUD::GetNameUID(ReturnPlayerName(playerid));
	  		if(BUD::GetIntEntry(userid, "autologin"))
			{
			    new IP[18];
			    BUD::GetStringEntry(userid, "ip", IP);
				if(! strcmp(IP, ReturnPlayerIP(playerid)))
			    {
					gUser[playerid][u_admin] = BUD::GetIntEntry(userid, "admin");
					SetPVarInt(playerid, "adminplayer", gUser[playerid][u_admin]);
					gUser[playerid][u_vip] = BUD::GetIntEntry(userid, "vip");
					SetPVarInt(playerid, "vipplayer", gUser[playerid][u_vip]);
					gUser[playerid][u_seke] = BUD::GetIntEntry(userid, "seke");
					gUser[playerid][u_kills] = BUD::GetIntEntry(userid, "kills");
					gUser[playerid][u_deaths] = BUD::GetIntEntry(userid, "deaths");
					gUser[playerid][u_score] = BUD::GetIntEntry(userid, "score");
					gUser[playerid][u_score2] = BUD::GetIntEntry(userid, "score2");
					gUser[playerid][u_money] = BUD::GetIntEntry(userid, "money");
					gUser[playerid][u_hours] = BUD::GetIntEntry(userid, "hours");
					gUser[playerid][u_minutes] = BUD::GetIntEntry(userid, "minutes");
					gUser[playerid][u_seconds] = BUD::GetIntEntry(userid, "seconds");
					BUD::SetIntEntry(userid, "jail", gUser[playerid][u_jailtime]);
			        BUD::SetIntEntry(userid, "mute", gUser[playerid][u_mutetime]);
		        	BUD::SetIntEntry(userid, "cmute", gUser[playerid][u_cmutetime]);
					 BUD::GetStringEntry(userid, "tag", gUser[playerid][u_tag]);

					BUD::SetIntEntry(userid, "logged", 1);

					SetPlayerScore(playerid, gUser[playerid][u_score]);

					GivePlayerCashEx(playerid, 10000);

					SendClientMessage(playerid, COLOR_GREEN, "ACCOUNT: Shoma Vared Shodid.");

					PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);

					gUser[playerid][u_logged] = true;
					return 1;
				}
			}
			new string[156];
			format(string, sizeof(string), ""WHITE"Acconut Shoma "RED"%s "WHITE"Ghablan Sabte Name Shode Ast..\n\n Jahat Vorod Password Khod Ra Vared Namayid", ReturnPlayerName(playerid));
			ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Vorod Be account", string, "Vorod", "Khoroj");
			return 1;
		}
		else
		{
			new string[156];
			format(string, sizeof(string), ""WHITE"In Account "RED"%s "WHITE"Hanoz Sabte Name Nashode Ast.\n\n Mitavanid Ba Vared Kardan Password Sabt Name Shavid", ReturnPlayerName(playerid));
			ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Sabt name Account", string, "Sabt Name", "Khoroj");
		}
	}
	return 1;
}
_______________________________________

Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_REGISTER)
	{
	    if(! response)
	    {
	        #if defined FORCE_REGISTER
		        GameTextForPlayer(playerid, "~r~~h~~h~~h~Khoda Negahdar", 5000, 1);

	        	DelayKick(playerid);
	        #else
				new string[156];
				format(string, sizeof(string), "guest%i%i_%s", random(1000), playerid, ReturnPlayerName(playerid));
	            SetPlayerName(playerid, string);//set player name to a random name, a guest to server
		        //don't worry, it will not collapse with other names!

		        gUser[playerid][u_logged] = false;
				gUser[playerid][u_guest] = true;

		        GameTextForPlayer(playerid, "~g~~h~~h~~h~Welcome Guest", 5000, 1);
	        #endif
	    }
	    else
	    {
	        if(strlen(inputtext) < 4 || strlen(inputtext) > 35)
			{
				new string[156];
				format(string, sizeof(string), ""WHITE" In Account "RED"%s "WHITE"Hanoz Sabt Nashode Ast.\n\n Ba Vared Kardan Password Mitavanid Sabte Name Shavid", ReturnPlayerName(playerid));
				ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Sabte Name account", string, "Sabte Name", "Khoroj");
				return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: Ramz Obor Na Motabar,  b/w 0-35.");
			}

			new DATE[18], date[3];
			getdate(date[0], date[1], date[2]);
			format(DATE, sizeof(DATE), "%i/%i/%i", date[2], date[1], date[0]);

            gUser[playerid][u_score] = GetPlayerScore(playerid);
            gUser[playerid][u_money] = GetPlayerMoney(playerid);

            BUD::RegisterName(ReturnPlayerName(playerid), inputtext);
			new userid = BUD::GetNameUID(ReturnPlayerName(playerid));
			BUD::SetStringEntry(userid, "ip", ReturnPlayerIP(playerid));
			BUD::SetStringEntry(userid, "joindate", DATE);
			BUD::SetStringEntry(userid, "laston", DATE);
			BUD::SetIntEntry(userid, "admin", gUser[playerid][u_admin]);
			BUD::SetIntEntry(userid, "vip", gUser[playerid][u_vip]);
			BUD::SetIntEntry(userid, "seke", gUser[playerid][u_seke]);
			BUD::SetIntEntry(userid, "kills", gUser[playerid][u_kills]);
			BUD::SetIntEntry(userid, "deaths", gUser[playerid][u_deaths]);
			BUD::SetIntEntry(userid, "score", GetPlayerScore(playerid));
			BUD::SetIntEntry(userid, "money", GetPlayerMoney(playerid));
			BUD::SetIntEntry(userid, "hours", gUser[playerid][u_hours]);
			BUD::SetIntEntry(userid, "minutes", gUser[playerid][u_minutes]);
			BUD::SetIntEntry(userid, "seconds", gUser[playerid][u_seconds]);
			BUD::SetIntEntry(userid, "jail", gUser[playerid][u_jailtime]);
			BUD::SetIntEntry(userid, "mute", gUser[playerid][u_mutetime]);
			BUD::SetIntEntry(userid, "cmute", gUser[playerid][u_cmutetime]);
			BUD::SetIntEntry(userid, "logged", 0);
			BUD::SetStringEntry(userid, "tag", gUser[playerid][u_tag]);

    		gUser[playerid][u_logged] = true;

			new string[156];
			format(string, sizeof(string), "~g~~h~~h~~h~Welcome~n~~g~~h~~h~~h~%s", ReturnPlayerName(playerid));
		    GameTextForPlayer(playerid, string, 5000, 1);

			PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
			SendClientMessage(playerid, COLOR_BLUE, "Player Aziz Shoma Ba Movafaghiat Vared Account Khod Shodid.");
	    }
	}
	if(dialogid == DIALOG_LOGIN)
	{
	    if(! response)
	    {
	        #if defined FORCE_REGISTER
		        GameTextForPlayer(playerid, "~r~~h~~h~~h~Khoda Negahdar", 5000, 1);

	        	DelayKick(playerid);
	        #else
				new string[156];
				format(string, sizeof(string), "guest%i%i_%s", random(1000), playerid, ReturnPlayerName(playerid));
	            SetPlayerName(playerid, string);//set player name to a random name, a guest to server
				//don't worry, it will not collapse with other names!

		        gUser[playerid][u_logged] = false;
				gUser[playerid][u_guest] = true;

		        GameTextForPlayer(playerid, "~g~~h~~h~~h~Welcome Guest", 5000, 1);
	        #endif
	    }
	    else
	    {
	        if(strlen(inputtext) < 4 || strlen(inputtext) > 35)
			{
				new string[156];
				format(string, sizeof(string), ""WHITE"In Account "RED"%s "WHITE"Ghablan Sabt Name Shode Ast.\n\n Jahat Vorod Password Khod Ra Vared Namayid", ReturnPlayerName(playerid));
				ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Vorod Be account", string, "Vorod", "Khoroj");
				return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: Ramz Obor Na Motabar, Bayad b/w 0-35.");
			}

	        if(BUD::CheckAuth(ReturnPlayerName(playerid), inputtext))
	        {
	            new userid = BUD::GetNameUID(ReturnPlayerName(playerid));
					gUser[playerid][u_admin] = BUD::GetIntEntry(userid, "admin");
					SetPVarInt(playerid, "adminplayer", gUser[playerid][u_admin]);
					gUser[playerid][u_vip] = BUD::GetIntEntry(userid, "vip");
					SetPVarInt(playerid, "vipplayer", gUser[playerid][u_vip]);
					gUser[playerid][u_seke] = BUD::GetIntEntry(userid, "seke");
					gUser[playerid][u_kills] = BUD::GetIntEntry(userid, "kills");
					gUser[playerid][u_deaths] = BUD::GetIntEntry(userid, "deaths");
					gUser[playerid][u_score] = BUD::GetIntEntry(userid, "score");
					gUser[playerid][u_score2] = BUD::GetIntEntry(userid, "score2");
					gUser[playerid][u_money] = BUD::GetIntEntry(userid, "money");
					gUser[playerid][u_hours] = BUD::GetIntEntry(userid, "hours");
					gUser[playerid][u_minutes] = BUD::GetIntEntry(userid, "minutes");
					gUser[playerid][u_seconds] = BUD::GetIntEntry(userid, "seconds");
					BUD::SetIntEntry(userid, "jail", gUser[playerid][u_jailtime]);
		        	BUD::SetIntEntry(userid, "mute", gUser[playerid][u_mutetime]);
	        		BUD::SetIntEntry(userid, "cmute", gUser[playerid][u_cmutetime]);
					BUD::GetStringEntry(userid, "tag",gUser[playerid][u_tag]);

            	BUD::SetIntEntry(userid, "logged", 1);

				SetPlayerScore(playerid, gUser[playerid][u_score]);

				ResetPlayerCashEx(playerid);
				GivePlayerCashEx(playerid, gUser[playerid][u_money]);

				SendClientMessage(playerid, COLOR_BLUE, "Player Aziz Shoma Ba Movafaghiat Vared Account Khod Shodid.");

				PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);

				new string[156];
				format(string, sizeof(string), "~g~~h~~h~~h~Welcome~n~~g~~h~~h~~h~%s", ReturnPlayerName(playerid));
			    GameTextForPlayer(playerid, string, 5000, 1);

				gUser[playerid][u_attempts] = 0;
				gUser[playerid][u_logged] = true;
	        }
	        else
	        {
				new string[156];

	            SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: Password Eshtebah Mibashad.Lotfan Be Shekl Sahih Vared Namayid!");

				#if MAX_LOGIN_ATTEMPTS > 0
					gUser[playerid][u_attempts]++;
		            if(gUser[playerid][u_attempts] >= MAX_LOGIN_ATTEMPTS)
		            {
		                format(string, sizeof(string), "* %s[%d] Az Server Kick Shod [Dalil: Eshtebah Vared Kardan Password]", ReturnPlayerName(playerid), playerid);
		                SendClientMessageToAll(COLOR_RED, string);
						DelayKick(playerid);
						return 1;
		            }
					format(string, sizeof(string), "WARNING: You have %i/"#MAX_LOGIN_ATTEMPTS" tries left to login.", gUser[playerid][u_attempts]);
     				SendClientMessage(playerid, COLOR_STEEL_BLUE, string);
				#endif
				format(string, sizeof(string), ""WHITE"In Account "RED"%s "WHITE"Ghablan Sabte Name Shode Ast.\n\n Jahat Vorod Password Khod Ra Vared Namayid", ReturnPlayerName(playerid));
				ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Vorod Be Account", string, "Vorod", "Khoroj");
			}
	    }
	}
return 1;
______________________________________

not Saved
__________________
Life doesn't get easier، you just get stronger :)
zeus99 is offline   Reply With Quote
Old 05/12/2019, 06:59 PM   #8
zeus99
Little Clucker
 
zeus99's Avatar
 
Join Date: Jun 2019
Location: Hell
Posts: 37
Reputation: 0
Default Re: How To Save Jail - mute - disarm - on player exit and relog

Help
__________________
Life doesn't get easier، you just get stronger :)
zeus99 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
y_ini Save Exit House pos player astanalol Scripting Help 2 21/02/2016 12:52 PM
Help! Save mute system and admin jail system. Firstaction Scripting Help 3 11/05/2014 07:44 PM
/ajail /jail - server crash when player relog jailed. AdamCooper Scripting Help 3 27/06/2012 04:06 PM
Save/load player skin after exit (/q) kbalor Scripting Help 3 26/06/2012 01:44 PM
How to make my rental cars save when player exit Steven82 Help Archive 0 05/05/2010 09:53 PM


All times are GMT. The time now is 02:59 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.