28.11.2012, 07:21
pawn Код:
CMD:hsetprice(playerid, params[]) {
if(playerVariables[playerid][pStatus] >= 1) {
for(new x = 0; x < MAX_HOUSES; x++) {
if(IsPlayerInRangeOfPoint(playerid, 5, houseVariables[x][hHouseExteriorPos][0], houseVariables[x][hHouseExteriorPos][1], houseVariables[x][hHouseExteriorPos][2])) {
{
new
//houseID,
housePrice;
if(sscanf(params, "dd", housePrice))
return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/hprice [houseid] [price]");
if(houseID < 1 || houseID > MAX_HOUSES)
return SendClientMessage(playerid, COLOR_GREY, "Invalid house ID.");
format(szMessage, sizeof(szMessage), "You have set house %d's price to $%d.", houseID, housePrice);
SendClientMessage(playerid, COLOR_WHITE, szMessage);
houseVariables[houseID][hHousePrice] = housePrice;
if(!strcmp(houseVariables[houseID][hHouseOwner], "Nobody", true) && strlen(houseVariables[houseID][hHouseOwner]) >= 1) {
switch(houseVariables[houseID][hHouseLocked]) {
case 0: format(szMessage, sizeof(szMessage), "House %d (un-owned - /buyhouse)\nPrice: $%d\n\n(locked)", houseID, houseVariables[houseID][hHousePrice]);
default: format(szMessage, sizeof(szMessage), "House %d (un-owned - /buyhouse)\nPrice: $%d\n\nPress ~k~~PED_DUCK~ to enter.", houseID, houseVariables[houseID][hHousePrice]);
}
UpdateDynamic3DTextLabelText(houseVariables[houseID][hLabelID], COLOR_YELLOW, szMessage);
}
}
}
}
return 1;
}