30.05.2009, 12:32
Ok, If this code works, Then people who want a really really really really basic house system, Read this
If some are wrong may you point out please
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;
}