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


Messages In This Thread
House System - by JoeDaDude - 30.05.2009, 12:32
Re: House System - by Ignas1337 - 30.05.2009, 13:45
Re: House System - by Think - 30.05.2009, 13:47
Re: House System - by JoeDaDude - 30.05.2009, 15:05

Forum Jump:


Users browsing this thread: 1 Guest(s)