Jump to content
  • 0

Problema system House


cristian9900

Question

Problema intalnita (descriere):Am adaugat cas prin comanda /createhouse , iar daca un player cumpara casa , dupa ce intra din nou in joc are rent in alta casa , sau daca intri intr-o casa ,si vrei sa iesi , te duce la alta casa ...
Ero(area / rile) / warning-(ul / urile):=
Liniile de cod / sursa / script-ul(obligatoriu): Am sa va dau Ce am eu in gamemode adica ce tine de house 

public OnPropTextdrawUpdate(update, h)
{
    new PropertyString[256];
    if(update == 1)
    {
        if(HouseInfo[h][hOwned] == 0)
        {
            DestroyDynamic3DTextLabel(HouseLabel[h]);
            DestroyDynamicPickup(HouseInfo[h][hPickupID]);
            HouseInfo[h][hPickupID] = CreateDynamicPickup(1273, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
            format(PropertyString, sizeof(PropertyString),"{FFFFFF}Casa {54CC56}%d \n{FFFFFF}Aceasta casa este de vanzare\nDescription: {54CC56}%s \n{FFFFFF}Valoare: {54CC56}$%s \n{FFFFFF}Nivel: {54CC56}%d \n{FFFFFF}Pentru a cumpara aceasta casa, tasteaza {54CC56}/buyhouse",h,HouseInfo[h][hDiscription],FormatNumber(HouseInfo[h][hValue]),HouseInfo[h][hLevel]);
            HouseLabel[h] = CreateDynamic3DTextLabel(PropertyString ,0x09FF00FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
        }
        else if(HouseInfo[h][hOwned] == 1)
        {
            if(HouseInfo[h][hRentabil] == 1)
            {
                DestroyDynamic3DTextLabel(HouseLabel[h]);
                format(PropertyString, sizeof(PropertyString),"{54CC56}%s{FFFFFF}\nCasa {54CC56}%d \n{FFFFFF}Casa detinuta de: {54CC56}%s \n{FFFFFF}Chirie: {54CC56}$%s \n{FFFFFF}Nivel: {54CC56}%d \n{FFFFFF}Pentru a lua chirie la aceasta casa, tasteaza {54CC56}/rentroom",HouseInfo[h][hDiscription],h,HouseInfo[h][hOwner],FormatNumber(HouseInfo[h][hRent]),HouseInfo[h][hLevel]);
                HouseLabel[h] = CreateDynamic3DTextLabel(PropertyString ,0x09FF00FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
            }
            else
            {
                DestroyDynamic3DTextLabel(HouseLabel[h]);
                format(PropertyString, sizeof(PropertyString),"{54CC56}%s{FFFFFF}\nCasa {54CC56}%d \n{FFFFFF}Casa detinuta de: {54CC56}%s \n{FFFFFF}Nivel: {54CC56}%d",HouseInfo[h][hDiscription],h,HouseInfo[h][hOwner], HouseInfo[h][hLevel]);
                HouseLabel[h] = CreateDynamic3DTextLabel(PropertyString ,0x09FF00FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
            }
            DestroyDynamicPickup(HouseInfo[h][hPickupID]);
            HouseInfo[h][hPickupID] = CreateDynamicPickup(1272, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
        }

 

 

 

// Property and Afacere
    new PropertyString[256];
    for(new h = 1; h <= housess; h++)
    {
        if(HouseInfo[h][hOwned] == 0)
        {
            DestroyDynamic3DTextLabel(HouseLabel[h]);
            format(PropertyString, sizeof(PropertyString),"{FFFFFF}Casa {54CC56}%d \n{FFFFFF}Aceasta casa este de vanzare\nDescription: {54CC56}%s \n{FFFFFF}Valoare: {54CC56}$%s \n{FFFFFF}Nivel: {54CC56}%d \n{FFFFFF}Pentru a cumpara aceasta casa, tasteaza {54CC56}/buyhouse",h,HouseInfo[h][hDiscription],FormatNumber(HouseInfo[h][hValue]),HouseInfo[h][hLevel]);
            HouseLabel[h] = CreateDynamic3DTextLabel(PropertyString ,0x09FF00FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
            HouseInfo[h][hPickupID] = CreateDynamicPickup(1273, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
        }
        else if(HouseInfo[h][hOwned] == 1)
        {
            if(HouseInfo[h][hRentabil] == 1)
            {
                DestroyDynamic3DTextLabel(HouseLabel[h]);
                format(PropertyString, sizeof(PropertyString),"{54CC56}%s\n {FFFFFF}Casa {54CC56}%d \n{FFFFFF}Casa detinuta de: {54CC56}%s \n{FFFFFF}Chirie: {54CC56}$%s \n{FFFFFF}Nivel: {54CC56}%d \n{FFFFFF}Pentru a lua chirie la aceasta casa, tasteaza {54CC56}/rentroom",HouseInfo[h][hDiscription],h,HouseInfo[h][hOwner],FormatNumber(HouseInfo[h][hRent]),HouseInfo[h][hLevel]);
                HouseLabel[h] = CreateDynamic3DTextLabel(PropertyString ,0x09FF00FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
            }
            else
            {
                DestroyDynamic3DTextLabel(HouseLabel[h]);
                format(PropertyString, sizeof(PropertyString),"{54CC56}%s\n {FFFFFF}Casa {54CC56}%d \n{FFFFFF}Casa detinuta de: {54CC56}%s \n{FFFFFF}Nivel: {54CC56}%d",HouseInfo[h][hDiscription],h,HouseInfo[h][hOwner], HouseInfo[h][hLevel]);
                HouseLabel[h] = CreateDynamic3DTextLabel(PropertyString ,0x09FF00FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
            }
            HouseInfo[h][hPickupID] = CreateDynamicPickup(1272, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);

 

 

 

// HOUSE SAVE
public HUpdate(hid, type)
{
    new var[256];
    switch(type)
    {
        case hExitxx:
        {
            format(var, sizeof(var), "UPDATE `houses` SET `Exitx`='%f' WHERE `ID`='%d'",HouseInfo[hid][hExitx], hid);
            mysql_query(SQL ,var);
        }
        case hExityx:
        {
            format(var, sizeof(var), "UPDATE `houses` SET `Exity`='%f' WHERE `ID`='%d'",HouseInfo[hid][hExity], hid);
            mysql_query(SQL ,var);
        }
        case hExitzx:
        {
            format(var, sizeof(var), "UPDATE `houses` SET `Exitz`='%f' WHERE `ID`='%d'",HouseInfo[hid][hExitz], hid);
            mysql_query(SQL ,var);
        }
        case hInteriorx:
        {
            format(var, sizeof(var), "UPDATE `houses` SET `Interior`='%d' WHERE `ID`='%d'",HouseInfo[hid][hInterior], hid);
            mysql_query(SQL ,var);
        }
    }
    return 1;
}

 


Imagini / Video (optional):
Ati incercat sa rezolvati singur?:  da

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

 if (newkeys & KEY_SECONDARY_ATTACK)
   {
       new string[300];
       if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
       {
           if(IsPlayerConnected(playerid))
           {
               for(new i = 1; i < sizeof(HouseInfo); i++)
               {
                   if(IsPlayerInRangeOfPoint(playerid,2,HouseInfo[hEntrancex], HouseInfo[hEntrancey], HouseInfo[hEntrancez]))
                   {
                       if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[hLock] == 0)
                       {
                           SetPlayerInterior(playerid,HouseInfo[hInterior]);
                           SetPlayerPos(playerid,HouseInfo[hExitx],HouseInfo[hExity],HouseInfo[hExitz]);
                           GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
                           PlayerInfo[playerid][pInt] = HouseInfo[hInterior];
                           PlayerInfo[playerid][pLocal] = i;
                           SetPlayerVirtualWorld(playerid,HouseInfo[hVirtual]);
                           InHouse[playerid] = i;
                       }
                       else
                       {
                           GameTextForPlayer(playerid, "~r~~h~Inchis", 5000, 1);
                       }
                   }

problema este teleportul aiurea din casa in casa , si indiferent de rent te spawneaza  doar la o casa 

Link to comment
Share on other sites

  • 0

stai putin nu inteleg de ce ai asa

HouseInfo[hEntrancex],

si nu ai asa?

HouseInfo [ i ]  [Entracex]

pentru ce mai e forul nu intelg cine face sistemele astea de case

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.