04.07.2014, 13:55
Yes, we are not here to spoon feed you code, you're meant to do that yourself with our help.
Feeding you the code is not the point of this community. Anyways...
This what I mean
Feeding you the code is not the point of this community. Anyways...
This what I mean
pawn Код:
CMD:npirkti(playerid,params[])
{
new h = -1; // house id
for ( ; h < MAX_HOUSES; h++)
{
if (IsPlayerInRangeOfPoint(playerid, 5, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ]))
break;
}
if (h != -1)
{
if (!strcmp(HouseInfo[h][hOwnerName], pName, false))
{
if (HouseInfo[h][hOwned] == 0)
{
if (GetPlayerMoney(playerid) > HouseInfo[h][hPrice])
{
strmid(HouseInfo[h][hOwnerName], pName, 0, strlen(pName),MAX_PLAYER_NAME);
HouseInfo[h][hOwned] = 1;
GivePlayerMoney(playerid,-HouseInfo[h][hPrice]);
SendClientMessage(playerid, COL_RED,"Sveikiname, nusipirkote nama! Visas komandas rasite /namai."); // Congratz you bought the house!
HouseInfo[h][hIsRented] = 0;
new labelstring[500];
DestroyDynamic3DTextLabel(HouseInfo[h][hLabel]);
DestroyDynamicMapIcon(HouseInfo[h][hIcon]);
DestroyDynamicPickup(HouseInfo[h][hPickup]);
format(labelstring, sizeof(labelstring),""TCCYAN"Savininkas: "TCRED"%s\n"TCCYAN"Nuoma: "TCRED"%s\n"TCCYAN"Nuomos kaina: "TCRED"%d\n"TCCYAN"Adresas: "TCRED"%s", HouseInfo[h][hOwnerName],HouseInfo[h][hRenter],HouseInfo[h][hRentPrice],HouseInfo[h][hAddress]);
HouseInfo[h][hLabel] = CreateDynamic3DTextLabel(labelstring, COL_GREEN, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ], 20);
HouseInfo[h][hPickup] = CreateDynamicPickup(1272, 1, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ]);
HouseInfo[h][hIcon] = CreateDynamicMapIcon(HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ], 32, 0,0);
SaveHouseData(h);
return 1;
}
else SendClientMessage(playerid, COL_RED, "Jums neuztenka pinigu ipirkti siam namui!"); //You dont have enough money to buy this house
}
else SendClientMessage(playerid, COL_RED, "Sis namas jau nupirktas!Jei jis nuomuojamas gali ji nuomuoti."); //This house is already bought , yuo can rent it if its rentable
}
else SendClientMessage(playerid, COL_RED, "Tu jau turi namus!"); // You already have house
}
else SendClientMessage(playerid, COL_RED, "Jus nesate prie parduodamo namo!"); // You're not a near house that is sellable
return 1;
}
