SA-MP Forums Archive
need help pls - 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 pls (/showthread.php?tid=205410)



need help pls - Abraham2nds - 01.01.2011

when someone tries to buy house it says Feature disable..
But how can i enable it?
pawn Код:
if(HousingOn == 0) return SendClientMessage(playerid, COLOR_RED,"Feature Disabled: Buying new houses is currently unavailable");



Re: need help pls - Grim_ - 01.01.2011

Change the variable 'HousingOn' to 1 (or any value other than 0) somewhere, most likely in OnFilterScriptInit. An example would be
pawn Код:
public OnFilterScriptInit( )
{
   HousingOn = 1;
   return 1;
}



Re: need help pls - Abraham2nds - 01.01.2011

ty i saw it....but i didnt seen it under onfilerscriptinit i saw it like where the new and define and foward is on top but i saw it ..changed it to 1 ...gonna test TY


Re: need help pls - Grim_ - 01.01.2011

Yeah, that will work fine to, I suppose.


Re: need help pls - Abraham2nds - 01.01.2011

ok i tested didnt work (


Re: need help pls - blackwave - 01.01.2011

Then do a command setting on/off..
pawn Код:
if(strcmp("/on",cmdtext,true,10) == 0)
{
    HousingOn=1;
    return 1;
}
if(strcmp("/off",cmdtext,true,10) == 0)
{
    HousingOn=0;
    return 1;
}
Also do you have a condition which checks if the "HousingOn" is on/off while attemp to buyin' a house?


Re: need help pls - Abraham2nds - 01.01.2011

Quote:
Originally Posted by blackwave
Посмотреть сообщение
Then do a command setting on/off..
pawn Код:
if(strcmp("/on",cmdtext,true,10) == 0)
{
    HousingOn=1;
    return 1;
}
if(strcmp("/off",cmdtext,true,10) == 0)
{
    HousingOn=0;
    return 1;
}
Also do you have a condition which checks if the "HousingOn" is on/off while attemp to buyin' a house?
what's the point? its already 1 by manual so...doesnt make a difference...
any other ideas?


Re: need help pls - Mean - 01.01.2011

Try to enum it

pawn Код:
enum HousingInfo
{
    HousingOn
}
new HousingInfo[HousingInfo];
So now we will use:
pawn Код:
if(strcmp("/on",cmdtext,true,10) == 0)
{
    HousingInfo[HousingOn] = 1;
    return 1;
}
if(strcmp("/off",cmdtext,true,10) == 0)
{
    HousingInfo[HousingOn] = 0;
    return 1;
}



Re: need help pls - Grim_ - 01.01.2011

There is no need to create something that takes up more memory when not needed.

Search in the script (CTR + F) for "HousingOn = 0" or "HousingOn=0" - If there are any results, replace the '0' with '1'.