House System
#1

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
Reply
#2

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
Reply
#3

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?
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)