Dynamic Housing [Scratch] -
JonathanW - 27.06.2014
Today,I'll be releasing my DYNAMIC HOUSING system.It's from Scratch and has many features.Let's continue with this thingy.
Features
Saving These Variables.
Code:
[HOUSE INFO]
Owner,
Owned,
Price,
Float: EnterX,
Float: EnterY,
Float: EnterZ,
Float: EnterA,
Float: ExitX,
Float: ExitY,
Float: ExitZ,
Float: ExitA,
EnterInt,
EnterVW,
ExitInt,
ExitVW,
Money,
Text3D: Label,
PickupID,
Locked
[PLAYER INFO]
House Owner,
House Key
Commands
Code:
/createhouse [level] - [L1 - L2 - L3 - L4]
/deletehouse [HouseID] - Deletes a Selected House ID
/edithloc [houseid] - Sets an House Exterior to your Current Pos
/edithprice [HouseID] [Price] - Sets the price of an house
/sethmoney [houseID] [Amount] - Sets a house ID's Vault money
Player Commands
/buy - Stand near a House Icon(Buys a house)
/sell - Stand near your house(Sells . It gives you 50% of the money)
/lock - Stand near your house(Locks)
/putmoney [amount] - self explanatory
/takemoney [amount] - self explanatory
/knock - Stand near a House and the person inside the house will get a message
/shout [text] - To Shout from outside a House
Screenshots
/createhouse
/deletehouse
/buyhouse
Lock
/sellhouse
NEW NEW NEW
/knock
/shout
[NOTE]: When you sell a house,it gives you 50% of the total money you bought if for.To edit it,edit "#define SELLPERCENT 50" to your needs
Credits
SAMP - For Samp? (For the addiction xD)
How to Install?
- Use the Pawn File from the Download Link,provided below.
- Create a Folder
"Users" and "Houses" in scriptfiles.
- Add the filterscript in 'server.cfg'.
- Login as RCON ADMIN.
- Enjoy
Downloads
Pastebin (Version 1)
Pastebin (Version 2)
Solidfiles
Re: Dynamic Housing [Scratch] -
KayJ - 27.06.2014
Awesome! +rep

Keep it up
Re: Dynamic Housing [Scratch] -
AviPeker - 27.06.2014
Very Nice!
Re: Dynamic Housing [Scratch] -
Nitin - 27.06.2014
Awesome, Good efforts.
Re: Dynamic Housing [Scratch] -
Mark_Samp - 27.06.2014
Good job

maybe you can try to add House Icon on map
Re: Dynamic Housing [Scratch] -
JonathanW - 27.06.2014
Hm...Good idea.
Thanks Guys!
Re: Dynamic Housing [Scratch] -
Excel™ - 27.06.2014
Bad idea:
pawn Code:
stock Showlock(playerid)
{
new txdstring[128];
format(txdstring, sizeof(txdstring), "Locked");
TextDrawSetString(boxtext, txdstring);
TextDrawShowForPlayer(playerid, Box);
TextDrawShowForPlayer(playerid, boxtext);
SetTimerEx("HideTextdraws", 4000, false, "i", playerid);
return 1;
}
Why the usage of string
"txdstring", where you could make that even without it. Here you go:
pawn Code:
stock Showlock(playerid)
{
TextDrawSetString(boxtext, "Locked");
TextDrawShowForPlayer(playerid, Box);
TextDrawShowForPlayer(playerid, boxtext);
SetTimerEx("HideTextdraws", 4000, false, "i", playerid);
return 1;
}
Secondly the textdraw
"new Text:Statement;" must be a Player textdraw, Its because it may be irritating for users. If multiple users use 2 different commands that have usage of this textdraw, then its collapsing.
Third thing is that everywhere you have made usage of
"formats" by creating string and so on.
just like this one:
pawn Code:
format(txdstring, sizeof(txdstring), "Locked");
Instead you could simply use
TextDrawSetString.
* Actually must be a
PlayerTextDraw.
Here,
SetTimerEx("HideTextdraws", 4000, false, "i", playerid);, this timer, What if this timer is callback again after 2000 ms. You know, the text will disappear after 2000ms instead of 4000ms and after continuous interals, for some reason, it will be hided. So you need to have a variable for the timer and also KillTimer before setting it.
No unloading of houses or i may say no resetting of vars and destroying the 3Dtexts,mapicons,.....
>> This is some of the things i noticed were wrong. (just got quick through your code)
So i may say, you must correct it.
Re: Dynamic Housing [Scratch] -
JonathanW - 27.06.2014
Thank you very much.In Version 2,I'll fix it.Plus I never actually knew that String of a Textdraw can be set directly.
Thanks!
Re: Dynamic Housing [Scratch] -
ReD_HunTeR - 27.06.2014
Awesome, ill use ur v2 in my gm
Re: Dynamic Housing [Scratch] -
wanted428 - 27.06.2014
Good job bud, rep'ed you.
Re: Dynamic Housing [Scratch] -
maaz - 27.06.2014
just cool thanks
Re: Dynamic Housing [Scratch] -
Jankingston - 28.06.2014
Very nice job! +rep
Re: Dynamic Housing [Scratch] -
JonathanW - 28.06.2014
[NOTE]: Version 2 Released.
Changelog:
A Knock Command.(/knock)
A Shout command (/shout [text])
Changed all the Textdraws to 'PLAYER TEXTDRAWS'
Re: Dynamic Housing [Scratch] -
[L]azy[H]aze - 28.06.2014
Good effort +rep
Re: Dynamic Housing [Scratch] -
GeekSiMo - 28.06.2014
Goooood Job
Re: Dynamic Housing [Scratch] -
Frogger75 - 28.06.2014
Doesn't work, When i type /enter to enter the house, it does nothing, be sure to check your script before releasing it, just a heads up. :\
Re: Dynamic Housing [Scratch] -
JonathanW - 29.06.2014
Well, you have to
Press 'F' to enter/exit.
Sorry about, I didn't write this in the main thread.
Re: Dynamic Housing [Scratch] -
leomaddox - 29.06.2014
nice
Re: Dynamic Housing [Scratch] -
Excel™ - 29.06.2014
Here:
pawn Code:
new PlayerText:Statement[MAX_PLAYERS];
new PlayerText:Box[MAX_PLAYERS];
new PlayerText:boxtext[MAX_PLAYERS];
You don't need to add [MAX_PLAYERS] to player textdraws.
just replace them everywhere with:
pawn Code:
new PlayerText:Statement;
new PlayerText:Box;
new PlayerText:boxtext;
This will remove the looping and also increase the speed of the system.
Re: Dynamic Housing [Scratch] -
Kyance - 29.06.2014
could you upload it as .pwn, it's annoying to fix all the "loose indentitaton...." warnings (pastebin bug) e_e
well, looks nice i guess ( from the pics.. )