need help with house system
#4

Код:
    if( newkeys == KEY_WALK )
   {
       {
for(new house=0; house<maxhouses+1; house++)
      {
      if(!IsPlayerInRangeOfPoint(playerid,1,houseDB2[house][hx],houseDB2[house][hy],houseDB2[house][hz])) continue;
            if(!strcmp("no",houseDB[house][owner_name],true))
            {
            if(GetPlayerMoneyA(playerid) < houseDB[house][nkaina]) return SendClientMessage(playerid,COLOR_RED,"you don't have enough money.");
            if(GetPlayerScore(playerid) < 5000) return SendClientMessage(playerid,COLOR_RED,"Jyou need 5000 Xp.");
            GivePlayerMoneyA(playerid,-houseDB[house][nkaina]);
            new names[MAX_PLAYER_NAME];
            GetPlayerName(playerid,names,MAX_PLAYER_NAME);
            strmid(houseDB[house][owner_name],names,0,MAX_PLAYER_NAME,MAX_PLAYER_NAME);
            houseDB[house][setting]=random(5);
               new houseid = playerDB[playerid][rid][3];
            new file[128];
            format(file,sizeof(file),"saves/house/%i",houseid);
            if(!fexist(file)) dini_Create(file);
             dini_Set(file,"owner",names);
            dini_IntSet(file,"setting",houseDB[houseid][setting]);

            new dtext[38];
            format(dtext,sizeof(dtext),"house owner: %s",houseDB[house][owner_name]);
            Update3DTextLabelText(houseDB2[house][housetext],0x39A6C6FF,dtext);
            SendClientMessage(playerid,COLOR_GREEN,"you bought a house!");
            return 1;
         }
         else return SendClientMessage(playerid,COLOR_RED,"house not for sale!");
  }
           return 1; // Baigiame.
      }
   }
Reply


Messages In This Thread
need help with house system - by Dovydux - 16.07.2011, 09:12
Re: need help with house system - by SmileyForCheat - 16.07.2011, 09:19
Re: need help with house system - by MoroDan - 16.07.2011, 09:26
Re: need help with house system - by Dovydux - 16.07.2011, 09:46

Forum Jump:


Users browsing this thread: 1 Guest(s)