Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 20th, 2010 | Syntax: None | Size: 4.54 KB | Hits: 72 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1.         timer = SetTimer("House", 1000, 1);
  2. public House()
  3. {
  4.         new Float:oldposx, Float:oldposy, Float:oldposz;
  5.         new string[128];
  6.          new dialogs[50]
  7.         new text_info[256];
  8.         NameTimer();
  9.      
  10.  
  11.         for(new i = 0; i < MAX_PLAYERS; i++)
  12.         {
  13.        
  14.                 if(IsPlayerConnected(i))
  15.                 {
  16.                 for(new h = 0; h < sizeof(HouseInfo); h++)
  17.                                 {
  18.                 if(vars[i] == 1 && !PlayerToPoint(2.0, i, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]){
  19. vars = 0;
  20. }
  21.                                 new string[128];
  22.                                         if(PlayerToPoint(2.0, i, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]))
  23.                                         {
  24.  
  25.  
  26.                                                 if(HouseInfo[h][hOwned] == 1)
  27.                                                 {
  28.                                                         if(HouseInfo[h][hRentabil] == 0)
  29.                                                         {
  30.                                                                 if(vars[i] == 0)
  31.                          {
  32.                            SetPlayerCheckpoint(i,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],2.2);
  33.                                          format(string, sizeof(string), "This House is owned by %s and the rent is $%d",HouseInfo[h][hOwner],HouseInfo[h][hRent]);
  34.                       SendClientMessage(i, COLOR_GREEN, string);
  35. vars[i] = 1;
  36.                             }
  37.                                        
  38.                                                          Delete3DTextLabel(Text5);
  39.                                                                  Delete3DTextLabel(Text);
  40.  
  41.                               format(text_info,256,"[House is owned by %s] ",HouseInfo[h][hOwner]);
  42.                              Text4 = Create3DTextLabel(text_info,COLOR_NEWB,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,20.0,0,1);
  43.                                                                 //format(dialogs , sizeof(dialogs),"This House is owned by %s.",HouseInfo[h][hOwner]);
  44.                                                                 //ShowPlayerDialog(i ,HOUSE1,DIALOG_STYLE_MSGBOX ,"House1:",dialogs,"Enter" ,"Cancel" );
  45.  
  46.  
  47.                                                         }
  48.                                                         else
  49.                                                         {
  50.  
  51.  
  52.                                                         format(dialogs , sizeof(dialogs), "This House is owned by %s ",HouseInfo[h][hOwner]);
  53.                             //ShowPlayerDialog(i ,HOUSE1,DIALOG_STYLE_MSGBOX ,"House1:",dialogs,"Enter" ,"Cancel" );
  54.                              SetPlayerCheckpoint(i,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],2.2);
  55.                              Delete3DTextLabel(Text4);
  56.                               Delete3DTextLabel(Text);
  57.                               format(text_info,256,"[House is owned by %s Rent %d] ",HouseInfo[h][hOwner],HouseInfo[h][hRent]);
  58.                              Text5 = Create3DTextLabel(text_info,COLOR_NEWB,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,20.0,0,1);
  59.  
  60.  
  61.  
  62.  
  63.                                                         }
  64.                                                         return 1;
  65.                                                 }
  66.                                                 else
  67.                                                 {
  68.  
  69.  
  70.                       ShowPlayerDialog(i ,YES,DIALOG_STYLE_MSGBOX ,"House1","House is for sale","Buy" ,"Cancel" );
  71.                        SetPlayerCheckpoint(i,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],2.2);
  72.                            Delete3DTextLabel(Text4);
  73.                        format(text_info,256,"[House] is for sale for $%d,Level:%d",HouseInfo[h][hValue],HouseInfo[h][hLevel]);
  74.                              Text = Create3DTextLabel(text_info,0x20D6DFFF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,20.0,0,1);
  75.                      AddStaticPickup(1273, 2,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
  76.  
  77.  
  78.  
  79.  
  80.                                                 return 1;
  81.  
  82.                                         }
  83.                                 }
  84.                         }
  85.                 }
  86.         }
  87. }