Raised This Month: $32 Target: $400
 8% 

[DB] Database Manager


Post New Thread Reply   
 
Thread Tools Display Modes
LocutusH
Senior Member
Join Date: Dec 2007
Location: Hungary
Old 01-20-2008 , 12:41   Re: [DB] Database Manager
Reply With Quote #51

Hm.

Can you pls explain me, wth this command is?
  • sm_db_persit (deafult: "1") - Set to true to use persistant connection
Because the problem was, that i've set this to 0.
Since its back to 1, everything works, and no bugs...
__________________
LocutusH is offline
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 01-20-2008 , 17:11   Re: [DB] Database Manager
Reply With Quote #52

I just made some changes (add some extra checks) on SMbank:Mysql and this plugin

Try re-downloading them both

I am sorry for all the trouble I am causing :/
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
tkaway69
Senior Member
Join Date: Dec 2004
Location: Millbrook Alabama
Old 01-20-2008 , 22:36   Re: [DB] Database Manager
Reply With Quote #53

Could you please note your changes in your change log?
__________________
tkaway69 is offline
Send a message via AIM to tkaway69 Send a message via MSN to tkaway69 Send a message via Yahoo to tkaway69
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 01-20-2008 , 23:53   Re: [DB] Database Manager
Reply With Quote #54

Sorry, I have been quite busy lately (School mid-terms are comming up :/ )

I will post it now
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
LocutusH
Senior Member
Join Date: Dec 2007
Location: Hungary
Old 01-21-2008 , 01:15   Re: [DB] Database Manager
Reply With Quote #55

I dont know if you fixed that now, but i have discovered another bug:

If the bank (not the db manager) gets unloaded on a map (by cfg, for fy maps), on the next map where bank is again available, the users have -1 or 1 on their accounts... It seems only to affect people who were on the server at this time.
__________________
LocutusH is offline
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 01-21-2008 , 11:23   Re: [DB] Database Manager
Reply With Quote #56

Can't you just set "sm_bank_allow" to 0?
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
LocutusH
Senior Member
Join Date: Dec 2007
Location: Hungary
Old 01-21-2008 , 12:05   Re: [DB] Database Manager
Reply With Quote #57

Quote:
Originally Posted by Nican View Post
Can't you just set "sm_bank_allow" to 0?

Did that yesterday, now testing since then.
__________________
LocutusH is offline
DiscoBBQ
Veteran Member
Join Date: Jan 2005
Location: Clemson, South Carolina
Old 03-11-2008 , 16:00   Re: [DB] Database Manager
Reply With Quote #58

beyond epic,
thanks!
__________________
"Every man is guilty of all the good he did not do"
DiscoBBQ is offline
DiscoBBQ
Veteran Member
Join Date: Jan 2005
Location: Clemson, South Carolina
Old 03-12-2008 , 17:38   Re: [DB] Database Manager
Reply With Quote #59

Okay Im running into a problem I've been tweaking with for the past few hours, here it goes.

Alright Im using local sql and ive got a few variables to save (int money, int bank, int wages, str job) then im trying to save doorkeys and then they dont work once all these uncommented lines are uncommented.

Code:
//New Vault:
new Vault_Money;
new Vault_Bank;
new Vault_Wages;
new Vault_Job;

//Doors:
new Doors[9999];
new Owns_Door[33][9999];


//Save:
public RP_Save(Client)
{
	//Save:
	DB_SetInfo(Client, Vault_Money, Money[Client]);
	DB_SetInfo(Client, Vault_Bank, Bank[Client]);
	DB_SetInfo(Client, Vault_Wages, Wages[Client]);

	//Doors:
	/*new Max_Ents = GetMaxEntities();
	for(new i = 0; i < Max_Ents; i++)
	{
		new String:Classname[255];
		if(IsValidEntity(i))
		{
			GetEdictClassname(i, Classname, 255);
	
			if(StrEqual(Classname, "func_door") || StrEqual(Classname, "func_door_rotating") || StrEqual(Classname, "prop_door_rotating"))
			{
				DB_SetInfo(Client, Doors[i], Owns_Door[Client][i]);
			}
		}
	}*/

	//Vault Bug:
	new RP_Length, String:Fake_Job[255];

	RP_Length = strlen(Job[Client]);
	Fake_Job = Job[Client];
	Fake_Job[RP_Length] = Fake_Job[RP_Length - 1];

	DB_SetInfoString(Client, Vault_Job, Fake_Job);
}


//Load:
public Action:RP_Load(Handle:Timer, any:Client)
{
	//Initalize:
	new Load_Int, String:Load_String[255];

	//Ima Buy You A Drank:
	Load_Int = DB_GetColumn(Client, Vault_Money);
	Money[Client] = Load_Int;

	//Then, Ima Take You Home With Me:
	Load_Int = DB_GetColumn(Client, Vault_Bank);
	Bank[Client] = Load_Int;

	//I Got Money In The Bank:
	Load_Int = DB_GetColumn(Client, Vault_Wages);
	if(Load_Int < RP_DEFAULT_WAGES)
		Wages[Client] = RP_DEFAULT_WAGES;
	else
		Wages[Client] = Load_Int;
	
	//Meet Me In The Grey Cadalliac:
	DB_GetColumnString(Client, Vault_Job, Load_String, 255);
	if(StrEqual(Load_String, ""))
		Job[Client] = RP_DEFAULT_JOB;
	else
		Job[Client] = Load_String;

	//Shorty What You Think About That:
	/*new Max_Ents = GetMaxEntities();
	for(new i = 0; i < Max_Ents; i++)
	{
		new String:Classname[255];
		if(IsValidEntity(i))
		{
			GetEdictClassname(i, Classname, 255);
	
			if(StrEqual(Classname, "func_door") || StrEqual(Classname, "func_door_rotating") || StrEqual(Classname, "prop_door_rotating"))
			{
				Load_Int = DB_GetColumn(Client, Doors[i]);
				Owns_Door[Client][i] = Load_Int;
			}
		}
	}*/
	
	//Save:
	RP_Save(Client);
}


public DB_OnRowsUpdated()
{
	
	//Money:
	Vault_Money = DB_GetColumnId("RP_Money", true, true, DB_INT);
	if(Vault_Money == -1)
        	SetFailState("[SMRP] Could not create column!");

	//Bank:
	Vault_Bank = DB_GetColumnId("RP_Bank", true, true, DB_INT);
	if(Vault_Bank == -1)
        	SetFailState("[SMRP] Could not create column!");

	//Wages:
	Vault_Wages = DB_GetColumnId("RP_Wages", true, true, DB_INT);
	if(Vault_Wages == -1)
        	SetFailState("[SMRP] Could not create column!");

	//Job:
	Vault_Job = DB_GetColumnId("RP_Job", true, true, DB_STRING);
	if(Vault_Job == -1)
        	SetFailState("[SMRP] Could not create column!");

	//Load Doors:
	/* //Uncommenting this bugs saving.	
	new Max_Ents = GetMaxEntities();
	for(new i = 0; i < Max_Ents; i++)
	{
		new String:Classname[255], String:Save_String[32];
		if(IsValidEntity(i))
		{
			GetEdictClassname(i, Classname, 255);
	
			if(StrEqual(Classname, "func_door") || StrEqual(Classname, "func_door_rotating") || StrEqual(Classname, "prop_door_rotating"))
			{
				Format(Save_String, 32, "Door_%d", i);
				Doors[i] = DB_GetColumnId(Save_String, true, true, DB_INT);
				if(Doors[i] == -1)
					SetFailState("[SMRP] Could not create column!");
			}
		}
	}
	*/
}
The first regular variables save and load but when i uncomment the the doorkey saving (the stuff in /* blah */) the first variables save but dont load

From what I've narrowed down so far,
when i just uncomment the lines in DB_OnRowsUpdate the others dont load
but they are saved in the sql.

Hope you can help, thanks! karma everyday for a week if you do ;-)
__________________
"Every man is guilty of all the good he did not do"
DiscoBBQ is offline
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 03-12-2008 , 17:53   Re: [DB] Database Manager
Reply With Quote #60

Pinkfairie, I have a few questions before I make a good fix.

1. Is this plugin going to work only on 1 map?
2. Are you going to use it on MySQL or SQLite?
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
Reply



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

Forum Jump


All times are GMT -4. The time now is 17:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode