29.05.2015, 07:42
All house prices is 15000$ or 20000$
The new code after when i try all your suggestions:
The new code after when i try all your suggestions:
Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid) { printf("Player %i entering dynamic checkpoint %i", playerid, checkpointid); if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { new string[128]; for (new c=0; c<MAX_HOUSES; c++) { if(checkpointid == Houses[c][PickupID]) { if (IsPlayerInRangeOfPoint(1.5,playerid,Houses[c][EnterX], Houses[c][EnterY], Houses[c][EnterZ])) { if(Houses[c][HousePrice] != 0) { if(Houses[c][Owned] == 0) { SendClientMessage(playerid, COLOR_GREEN, "Doresti sa cumperi aceasta proprietate?"); format(string, sizeof(string), "Price: $%d", Houses[c][HousePrice]); SendClientMessage(playerid, COLOR_GREEN, string); SendClientMessage(playerid, COLOR_WHITE, "Available commands: /buyhouse, /enter, /ds(hout)"); } else { if(Houses[c][Rentable] == 1) { new string2[128]; format(string, sizeof(string), "[Adress: %d] You're standing on %s's porch.",c,Houses[c][Owner]); SendClientMessage(playerid, COLOR_GREEN, string); format(string2, sizeof(string2), "Available commands: /enter, /ds(hout), /rentroom (Price: $%d)", Houses[c][RentCost]); SendClientMessage(playerid, COLOR_WHITE, string2); } else { format(string, sizeof(string), "[Adress: %d] You're standing on %s's porch",c,Houses[c][Owner]); SendClientMessage(playerid, COLOR_GREEN, string); SendClientMessage(playerid, COLOR_WHITE, "Available commands: /enter, /ds(hout)"); } } } } } } } return 1; }