House System - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: House System (
/showthread.php?tid=79691)
House System -
JoeDaDude - 30.05.2009
Ok, If this code works, Then people who want a really really really really basic house system, Read this
pawn Код:
new house1;
new housebought1;
house1 = CreatePickup(1273,23,1442.5496,-628.8535,95.7186);
public OnPlayerPickUpPickup(playerid, pickupid)
{
if( pickupid == house1) {
new string[50];
format(string, sizeof(string), "This house is for sale ~n~ ~r /buyhouse");
GameTextForPlayer(playerid, string, 3000, 5);
}
if( pickupid == housebought1) {
new string[50];
format(string, sizeof(string), "This house is owned by: [name will go here]");
GameTextForPlayer(playerid, string, 3000, 5);
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/buyhouse", true))
{
if(PlayerToPoint(1.0,playerid,1442.5496,-628.8535,95.7186))
{
SendClientMessage(playerid, COLOR_WHITE, "You have bought this house");
DestroyPickup(house1);
housebought1 = CreatePickup(1273,23,1442.5496,-628.8535,95.7186);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are not near a house");
return 1;
}
return 0;
}
If some are wrong may you point out please
Re: House System -
Ignas1337 - 30.05.2009
for multiple houses I would suggest you use arrays like..
#define MAX_HOUSES 8 // or how many houses you want
HouseOwned[MAX_HOUSES];
or something like this.
and about that code, it isn't really correct
Re: House System -
Think - 30.05.2009
this isnt even close to a house system this is just a lazy mans ways to try to explain how they are made. not how it looks like, this hasnt got good support for:
Multiplie houses
Different owners
Locking
Vehicles?
Re: House System -
JoeDaDude - 30.05.2009
Its an admin house system where i assign house owners for admins only,
Like i edit it and make it so only they can enter ect, i dnt want a house system,
Just a easy way to see who owns what ect