SA-MP Forums Archive
need help with house system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: need help with house system (/showthread.php?tid=269369)



need help with house system - Dovydux - 16.07.2011

Hi,
I have a little problem I maked myself a house sytem, everything is ok pawno doesn't send errors, i logged into my server to check from first look it works, all textlabels are in places but when I press button it doens't do anything


Re: need help with house system - SmileyForCheat - 16.07.2011

Maybe You No ADD This?
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, tinputtext[])
{
Blah Blah



Re: need help with house system - MoroDan - 16.07.2011

Quote:
Originally Posted by Dovydux
Посмотреть сообщение
Hi,
I have a little problem I maked myself a house sytem, everything is ok pawno doesn't send errors, i logged into my server to check from first look it works, all textlabels are in places but when I press button it doens't do anything
Post the "button code".


Re: need help with house system - Dovydux - 16.07.2011

Код:
    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.
      }
   }