SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 23/09/2016, 08:43 AM   #121
Admireal
Big Clucker
 
Join Date: Sep 2016
Posts: 118
Reputation: 5
Unhappy Re: Yet Another House System

Houses not saving help guys!

Last edited by Admireal; 23/09/2016 at 03:57 PM.
Admireal is offline   Reply With Quote
Old 25/09/2016, 01:09 PM   #122
HoangNam
Big Clucker
 
HoangNam's Avatar
 
Join Date: Jun 2015
Location: Vietnam
Posts: 140
Reputation: 13
Default Re: Yet Another House System

Perfect. I will use it in my server
+rep
HoangNam is offline   Reply With Quote
Old 06/10/2016, 03:33 PM   #123
Plastikmensch
Huge Clucker
 
Join Date: Aug 2016
Posts: 272
Reputation: 27
Default Re: Yet Another House System

//If your houses aren't saving, you are probably running the server on linux.
The issue is, that OnFilterScriptExit is not called when you shutdown the samp server.
A quick fix is to call the SaveHouse function (as SecretBoss said) everytime you want your houses to be saved. Just replace:
Code:
HouseData[id][Save] = true;
with:
Code:
SaveHouse(id);
There is still an sql error in line 2160. Replace it with:
Code:
	mysql_format(SQLHandle, query, sizeof(query), "INSERT INTO houses SET ID=%d, HouseX=%f, HouseY=%f, HouseZ=%f, HousePrice=%d, HouseInterior=%d, LastEntered=%d", id, HouseData[id][houseX], HouseData[id][houseY], HouseData[id][houseZ], price, interior,HouseData[id][LastEntered]);

Last edited by Plastikmensch; 13/10/2016 at 11:26 AM.
Plastikmensch is offline   Reply With Quote
Old 06/10/2016, 03:53 PM   #124
SecretBoss
Gangsta
 
SecretBoss's Avatar
 
Join Date: Dec 2014
Location: Greece
Posts: 807
Reputation: 106
Default Re: Yet Another House System

Quote:
Originally Posted by Plastikmensch View Post
For those who have problems with houses not saving:
There is an Error in the script which causes this.
The column "LastEntered" has no default value and is set to not be NULL.
Because "HouseData[id][LastEntered]" in the script is not defined when using /createhouse, houses aren't saved.
So how to fix this?
Either connect to the sql server and execute:
Code:
ALTER TABLE `housedb`.`houses` 
CHANGE COLUMN `LastEntered` `LastEntered` INT(11) NOT NULL DEFAULT '0' ;
or open the pwn file and go to line 91 and change it to
Code:
LastEntered=0,
and edit line 2160 to
Code:
	mysql_format(SQLHandle, query, sizeof(query), "INSERT INTO houses SET ID=%d, HouseX=%f, HouseY=%f, HouseZ=%f, HousePrice=%d, HouseInterior=%d, LastEntered=%d", id, HouseData[id][houseX], HouseData[id][houseY], HouseData[id][houseZ], price, interior,HouseData[id][LastEntered]);
alternativly you can write LastEntered=0 instead of %d since it is 0 anyway.
If you don't want to edit this lines you can just change line 971 to:
Code:
strcat(query, "`LastEntered` int(11) default '0' NOT NULL,\
But this means you have to delete the database and create it again.

Edit: or you can just delete "NOT NULL"
If you want your house to be saved put script's saving function whenever the script modifies house's variables, so your houses will always save

As conserning LastEntered value it's fine, please don't judge the script without having basic MySQL and Pawn knowledge
__________________
SecretBoss is offline   Reply With Quote
Old 07/10/2016, 07:36 AM   #125
Plastikmensch
Huge Clucker
 
Join Date: Aug 2016
Posts: 272
Reputation: 27
Default Re: Yet Another House System

Yeah, you're right the value in the script is fine. Just the sql command at line 2160 produces an sql error. I just wanted to provide a simple solution.
//nvm corrected my first post

Last edited by Plastikmensch; 13/10/2016 at 06:30 PM.
Plastikmensch is offline   Reply With Quote
Old 25/10/2016, 05:51 AM   #126
MaticOwns
Little Clucker
 
MaticOwns's Avatar
 
Join Date: Oct 2016
Posts: 18
Reputation: 0
Default Re: Yet Another House System

Fixed errors

Last edited by MaticOwns; 25/10/2016 at 06:38 AM.
MaticOwns is offline   Reply With Quote
Old 25/10/2016, 06:36 AM   #127
MaticOwns
Little Clucker
 
MaticOwns's Avatar
 
Join Date: Oct 2016
Posts: 18
Reputation: 0
Default Re: Yet Another House System

Fixed the error! For all who having trouble with the mysql use https://github.com/pBlueG/SA-MP-MySQL/releases
MaticOwns is offline   Reply With Quote
Old 25/10/2016, 08:40 AM   #128
MaticOwns
Little Clucker
 
MaticOwns's Avatar
 
Join Date: Oct 2016
Posts: 18
Reputation: 0
Default Re: Yet Another House System

Quick question, I loaded the game mode eveything works fine but when i get in game and type commands it say invalid commands although im rcon
MaticOwns is offline   Reply With Quote
Old 25/10/2016, 02:38 PM   #129
HidroDF
Big Clucker
 
Join Date: Jun 2016
Posts: 122
Reputation: 2
Default Respuesta: Yet Another House System

Nice system

Last edited by HidroDF; 30/10/2016 at 11:27 AM.
HidroDF is offline   Reply With Quote
Old 06/11/2016, 10:53 AM   #130
Plastikmensch
Huge Clucker
 
Join Date: Aug 2016
Posts: 272
Reputation: 27
Default Re: Yet Another House System

Quote:
Originally Posted by MaticOwns View Post
Quick question, I loaded the game mode eveything works fine but when i get in game and type commands it say invalid commands although im rcon
Check the server log and the sql plugin log. This happens mostly if the script can't connect to the mysql server.
Plastikmensch 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
[FilterScript] [FS] v1.6e || Simple House System || 1 line = 1 house Antironix Filterscripts 1308 06/07/2020 07:35 PM
Gagi's House System's House cords problem Wahaj Scripting Help 2 03/07/2014 03:15 PM
House system , save house create Cerealguy Scripting Help 1 27/10/2013 11:34 PM
House system only loading 1 house. ricardo178 Scripting Help 8 19/02/2012 06:37 AM
GF script & house system and house cars Sexserghy Help Archive 4 27/03/2011 10:47 PM


All times are GMT. The time now is 09:40 AM.


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