SA-MP Forums Archive
Some Bugs On Commands - 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)
+--- Thread: Some Bugs On Commands (/showthread.php?tid=598221)



Some Bugs On Commands - dh240473 - 10.01.2016

Hi Guys I'm Trying To Make Lock House Commands But This CMD Are Bugged Can You Help Me?
PHP код:
CMD:lockh(playeridparams[])
{
    for(new 
0MAX_HOUSE;i++)
    {
        new 
file[999],string[999];
        if(
strfind(IsPlayerName(playerid),HInfo[i][Owner], true) == -1) return SendClientMessage(playerid0x99FF00AA""COL_RED"[House] "COL_YELLOW"You're not the House Owner!");
           if(
HInfo[i][HX] == -&& HInfo[i][HY] == -&& HInfo[i][HZ] == -1) return SendClientMessage(playerid0x99FF00AA""COL_RED"[House] "COL_YELLOW"You must at The House Checkpoint");
        
HInfo[i][Locked] = 1;
        
format(stringsizeof(string), ""warnalabel"House Owner: %s \nHouse Price: %d \nHouse Level: %d \nHouse Id: %d \nLocked: %d"IsPlayerName(playerid),HInfo[i][Price],HInfo[i][Level],iHInfo[Labelid][Locked]);
        
UpdateDynamic3DTextLabelText(HInfo[i][Labels],0xFF0000FF,string);
        
format(filesizeof(file), "House/%d.ini"i);
          
dini_IntSet(file"Locked"1);
        
SendClientMessage(playerid0x99FF00AA""COL_RED"[House] "COL_YELLOW"You Have Lock This House");
    }
    return 
1;

P/S: Sorry For Bad English


Re: Some Bugs On Commands - Sew_Sumi - 10.01.2016

What does it do, or what does it not do?



Something else in here, maybe have a "player owns house" variable on his account, so that you avoid checking all the houses before you check if he has one or not.


Re: Some Bugs On Commands - justice96 - 10.01.2016

Replace
Quote:

dini_IntSet(file, "Locked", 1);

To be
Quote:

dini_IntSet(file, "Locked", HInfo[i][Locked]);




Re: Some Bugs On Commands - dh240473 - 10.01.2016

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
What does it do, or what does it not do?
To Lock Own House ...