SA-MP Forums Archive
Levels. - 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: Levels. (/showthread.php?tid=490833)



Levels. - TheSnaKe - 28.01.2014

(Sorry, for double topic.)-----Hey guys, my house system it's work perfectly, but i want to add a level on it, like if someone is Level 1 and the house is for Level 2, he wouldn't be able to buy it, i tried to do it, but every time is not working or i get errors/warnings, so here is the /createhouse code.

PHP код:
}
CMD:createhouse(playeridparams[])
{
    new 
string[128];
    if(!
IsPlayerLoggedIn(playerid) || PlayerInfo[playerid][pAsshole] == 1) return SendClientMessage(playeridCOLOR_GREY"You are not allowed to use command.");
    if(
PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playeridCOLOR_GREY"You are not an authorized to use this command.");
    for(new 
idx=1idx<MAX_HOUSESidx++)
    {
        if(!
HouseInfo[idx][hLevel])
        {
            
// Getting Business Setup
            
new Float:XFloat:YFloat:Z;
            
GetPlayerPos(playeridXYZ);
            
// Making Business
            
HouseInfo[idx][hLevel] = 1;
            
HouseInfo[idx][hPrice] = 50000;
            
HouseInfo[idx][hStatus] = 0;
            
format(HouseInfo[idx][hOwner], 32"The State");
            
HouseInfo[idx][hX] = X;
            
HouseInfo[idx][hY] = Y;
            
HouseInfo[idx][hZ] = Z;
            
HouseInfo[idx][hMoney] = 0;
            
HouseInfo[idx][hMaterials] = 0;
            
HouseInfo[idx][hWeed] = 0;
            
HouseInfo[idx][hcocaine] = 0;
            
HouseInfo[idx][hGun][0] = 0;
            
HouseInfo[idx][hGunAmmo][0] = 0;
            
HouseInfo[idx][hGun][1] = 0;
            
HouseInfo[idx][hGunAmmo][1] = 0;
            
HouseInfo[idx][hGun][2] = 0



Re: Levels. - King Ace - 28.01.2014

You need to make something like that.
Код:
if(HouseInfo[idx][hLevel] > PlayerInfo[playerid][pLevel] return SendClientMessage(playerid, COLOR_GREY, "Your level isn't high enough");



Re: Levels. - TheSnaKe - 28.01.2014

Quote:
Originally Posted by King Ace
Посмотреть сообщение
You need to make something like that.
Код:
if(HouseInfo[idx][hLevel] > PlayerInfo[playerid][pLevel] return SendClientMessage(playerid, COLOR_GREY, "Your level isn't high enough");
So, i have to add this under
PHP код:
new string[128]; 
?


Re: Levels. - King Ace - 28.01.2014

Yes.