- timer = SetTimer("House", 1000, 1);
- public House()
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new string[128];
- new dialogs[50]
- new text_info[256];
- NameTimer();
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- for(new h = 0; h < sizeof(HouseInfo); h++)
- {
- if(vars[i] == 1 && !PlayerToPoint(2.0, i, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]){
- vars = 0;
- }
- new string[128];
- if(PlayerToPoint(2.0, i, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]))
- {
- if(HouseInfo[h][hOwned] == 1)
- {
- if(HouseInfo[h][hRentabil] == 0)
- {
- if(vars[i] == 0)
- {
- SetPlayerCheckpoint(i,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],2.2);
- format(string, sizeof(string), "This House is owned by %s and the rent is $%d",HouseInfo[h][hOwner],HouseInfo[h][hRent]);
- SendClientMessage(i, COLOR_GREEN, string);
- vars[i] = 1;
- }
- Delete3DTextLabel(Text5);
- Delete3DTextLabel(Text);
- format(text_info,256,"[House is owned by %s] ",HouseInfo[h][hOwner]);
- Text4 = Create3DTextLabel(text_info,COLOR_NEWB,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,20.0,0,1);
- //format(dialogs , sizeof(dialogs),"This House is owned by %s.",HouseInfo[h][hOwner]);
- //ShowPlayerDialog(i ,HOUSE1,DIALOG_STYLE_MSGBOX ,"House1:",dialogs,"Enter" ,"Cancel" );
- }
- else
- {
- format(dialogs , sizeof(dialogs), "This House is owned by %s ",HouseInfo[h][hOwner]);
- //ShowPlayerDialog(i ,HOUSE1,DIALOG_STYLE_MSGBOX ,"House1:",dialogs,"Enter" ,"Cancel" );
- SetPlayerCheckpoint(i,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],2.2);
- Delete3DTextLabel(Text4);
- Delete3DTextLabel(Text);
- format(text_info,256,"[House is owned by %s Rent %d] ",HouseInfo[h][hOwner],HouseInfo[h][hRent]);
- Text5 = Create3DTextLabel(text_info,COLOR_NEWB,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,20.0,0,1);
- }
- return 1;
- }
- else
- {
- ShowPlayerDialog(i ,YES,DIALOG_STYLE_MSGBOX ,"House1","House is for sale","Buy" ,"Cancel" );
- SetPlayerCheckpoint(i,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],2.2);
- Delete3DTextLabel(Text4);
- format(text_info,256,"[House] is for sale for $%d,Level:%d",HouseInfo[h][hValue],HouseInfo[h][hLevel]);
- Text = Create3DTextLabel(text_info,0x20D6DFFF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,20.0,0,1);
- AddStaticPickup(1273, 2,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
- return 1;
- }
- }
- }
- }
- }
- }
