[FilterScript] Dynamic Housing [Scratch]
#1



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

Reply
#2

Awesome! +rep
Keep it up
Reply
#3

Very Nice!
Reply
#4

Awesome, Good efforts.
Reply
#5

Good job
maybe you can try to add House Icon on map
Reply
#6

Hm...Good idea.
Thanks Guys!
Reply
#7

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.
Reply
#8

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!
Reply
#9

Awesome, ill use ur v2 in my gm
Reply
#10

Good job bud, rep'ed you.
Reply
#11

just cool thanks
Reply
#12

Very nice job! +rep
Reply
#13

[NOTE]: Version 2 Released.
Changelog:
A Knock Command.(/knock)
A Shout command (/shout [text])
Changed all the Textdraws to 'PLAYER TEXTDRAWS'
Reply
#14

Good effort +rep
Reply
#15

Goooood Job
Reply
#16

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. :\
Reply
#17

Well, you have to Press 'F' to enter/exit.
Sorry about, I didn't write this in the main thread.
Reply
#18

nice
Reply
#19

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.
Reply
#20

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.. )
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)