17.05.2010, 20:27
pawn Код:
public LoadPickups()
{
pickuptoggle = 1;
new string[128];
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(HouseInfo[h][hOwned] == 0)
{
Houses = CreateDynamicCP(HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ], 2.2000, -1, -1, -1, 25);
}
if(HouseInfo[h][hOwned] == 1)
{
HousesOwned = CreateDynamicCP(HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ],2.2000, -1, -1, -1, 25);
}
}
}
public OnPlayerEnterDynamicCP(playerid, checkpointid) //there should be no ; at the end, this is a callback
{
new Bool:bHouseO[MAX_PLAYERS] = 1;
new string[256];
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(bHouseO[playerid] == 1)
{
if(HouseInfo[h][hOwned] == 0)
{
if(checkpointid = Houses)
{
SendClientMessage(playerid, COLOR_GREEN, "Would you like to buy this house?");
SendClientMessage(playerid, COLOR_GREEN, "Price show in the text");
SendClientMessage(playerid, COLOR_WHITE, "Avilable Commands:/enter,(/buyhouse)");
bHouseO[playerid] = 0;
}
else if(HouseInfo[h][hOwned] == 0)
{
if(checkpointid = HousesOwned)
{
format(string, sizeof(string),"House is owned by %s",HouseInfo[h][hOwner]);
SendClientMessage(playerid,COLOR_WHITE,string);
bHouseO[playerid] = 0;
}
}
}
}
}
return 1;
}