SA-MP Forums Archive
Need help with setting interiors. - 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: Need help with setting interiors. (/showthread.php?tid=291705)



Need help with setting interiors. - oshrizzz - 21.10.2011

Morning guys, I've downloaded Los Heaven game mode and I'm having a little problem here I'd be happy if you help me to figure it out.
Here is the link to the gamemode : https://sampforum.blast.hk/showthread.php?tid=170874

Anyway, there's a command /createbusiness and /createhouse.
After I'm using these commands only the entrance to the businesses/houses getting created but as soon as I enter I fall down because there is no interior.
it might be dummy question but i srsly trying to figure it out for while now.

Here's the code, idk how to make it pwn forum code reply how to do and ill edit.

pawn Код:
if(strcmp(cmd, "/createhouse", true) == 0)
        {
            if (PlayerInfo[playerid][pAdmin] >= 4)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_SYSTEM, "[CMDINFO] - /createhouse [id] [price]");
                    return 1;
                }
                new id = strval(tmp);
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_SYSTEM, "[CMDINFO] - /createhouse [id] [price]");
                    return 1;
                }
                new price = strval(tmp);
                new Float:x,Float:y,Float:z;
                GetPlayerPos(playerid, x, y, z);
                HouseInfo[id][hEnterX] = x;
                HouseInfo[id][hEnterY] = y;
                HouseInfo[id][hEnterZ] = z;
                HouseInfo[id][EnterWorld] = GetPlayerVirtualWorld(playerid);
                HouseInfo[id][EnterInterior] = GetPlayerInterior(playerid);
                HouseInfo[id][hPrice] = price;
                HouseInfo[id][hOwned] = 0;
                HouseInfo[id][hRentable] = 0;
                SaveHouses();
                format(string, sizeof(string), "[House for sale]\nPrice: %d", HouseInfo[id][hPrice]);
                Move3DTextLabel(housetext[id], string, COLOR_SPRINGGREEN, x, y, z);
                return 1;
            }
        }
        if(strcmp(cmd, "/createbusiness", true) == 0)
        {
            if (PlayerInfo[playerid][pAdmin] >= 4)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_SYSTEM, "[CMDINFO] - /createbusiness [id] [type] [price] [name]");
                    SendClientMessage(playerid, COLOR_SYSTEM, "Types: 1: Phone | 2: 24-7 | 3: Cloths | 4: Hardware | 5: Cluckin Bell | 6: Gunshop");
                    SendClientMessage(playerid, COLOR_SYSTEM, "Types: 7: Bar | Club | 8: Advertising | 9: Record Company | 10: Burger Shot | 11: Pizza Store");
                    return 1;
                }
                new id = strval(tmp);
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_SYSTEM, "[CMDINFO] - /createbusiness [id] [type] [price] [name]");
                    SendClientMessage(playerid, COLOR_SYSTEM, "Types: 1: Phone | 2: 24-7 | 3: Cloths | 4: Hardware | 5: Cluckin Bell | 6: Gunshop");
                    SendClientMessage(playerid, COLOR_SYSTEM, "Types: 7: Bar | Club | 8: Advertising | 9: Record Company | 10: Burger Shot | 11: Pizza Store | 12: Donut");
                    return 1;
                }
                new Float:x,Float:y,Float:z;
                GetPlayerPos(playerid, x, y, z);
                BusinessInfo[id][bEnterX] = x;
                BusinessInfo[id][bEnterY] = y;
                BusinessInfo[id][bEnterZ] = z;
                BusinessInfo[id][EnterWorld] = GetPlayerVirtualWorld(playerid);
                BusinessInfo[id][EnterInterior] = GetPlayerInterior(playerid);
                new id2;
                id2 = strval(tmp);
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_SYSTEM, "[CMDINFO] - /createbusiness [id] [type] [price] [name]");
                    SendClientMessage(playerid, COLOR_SYSTEM, "Types: 1: Phone | 2: 24-7 | 3: Cloths | 4: Hardware | 5: Cluckin Bell | 6: Gunshop");
                    SendClientMessage(playerid, COLOR_SYSTEM, "Types: 7: Bar | Club | 8: Advertising | 9: Record Company | 10: Burger Shot | 11: Pizza Store | 12: Donut");
                    return 1;
                }
                new id3;
                id3 = strval(tmp);
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_SYSTEM, "[CMDINFO] - /createbusiness [id] [type] [price] [name]");
                    SendClientMessage(playerid, COLOR_SYSTEM, "Types: 1: Phone | 2: 24-7 | 3: Cloths | 4: Hardware | 5: Cluckin Bell | 6: Gunshop");
                    SendClientMessage(playerid, COLOR_SYSTEM, "Types: 7: Bar | Club | 8: Advertising | 9: Record Company | 10: Burger Shot | 11: Pizza Store | 12: Donut");
                    return 1;
                }
                new length = strlen(cmdtext);
                while ((idx < length) && (cmdtext[idx] <= ' '))
                {
                    idx++;
                }
                new offset = idx;
                new result[64];
                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                {
                    result[idx - offset] = cmdtext[idx];
                    idx++;
                }
                result[idx - offset] = EOS;
                BusinessInfo[id][bType] = id2;
                strmid(BusinessInfo[id][bName], (result), 0, strlen((result)), 128);
                BusinessInfo[id][bPrice] = id3;
                format(string, sizeof(string), "[INFO:] Business ID %d, Is a type %d Business and Cost %d, Named - %s", id, id2, id3, result);
                SendClientMessage(playerid, COLOR_SYSTEM, string);
                SaveBusinesses();
                if(BusinessInfo[id][bOwned] == 0)
                {
                    format(string, sizeof(string), "%s\nBusiness for Sale\nAvailable Price is $%d.00", BusinessInfo[id][bName],BusinessInfo[id][bPrice]);
                    Move3DTextLabel(businesstext[id], string, COLOR_ORANGERED, x, y, z);
                }
                else
                {
                    new businesstype[128];
                    if(BusinessInfo[idx][bType] != 0)
                    {
                        if(BusinessInfo[idx][bType] == 1) { businesstype = "Phone Company"; }
                        else if(BusinessInfo[idx][bType] == 2) { businesstype = "24-7"; }
                        else if(BusinessInfo[idx][bType] == 3) { businesstype = "Clothes Store"; }
                        else if(BusinessInfo[idx][bType] == 4) { businesstype = "HardWare Store"; }
                        else if(BusinessInfo[idx][bType] == 5) { businesstype = "Cluckin Bell"; }
                        else if(BusinessInfo[idx][bType] == 6) { businesstype = "Gun Shop"; }
                        else if(BusinessInfo[idx][bType] == 7) { businesstype = "Bar | Club"; }
                        else if(BusinessInfo[idx][bType] == 8) { businesstype = "Advertising"; }
                        else if(BusinessInfo[idx][bType] == 9) { businesstype = "Record Company"; }
                        else if(BusinessInfo[idx][bType] == 10) { businesstype = "Burger Shot"; }
                        else if(BusinessInfo[idx][bType] == 11) { businesstype = "Pizza Store"; }
                        else if(BusinessInfo[idx][bType] == 12) { businesstype = "Donut Shop"; }
                    }
                    else { businesstype = "Empty Business"; }
                    format(string, sizeof(string), "%s\nOwner: %s\n%s Store", BusinessInfo[id][bName],BusinessInfo[id][bOwner],businesstype);
                    Move3DTextLabel(businesstext2[id], string, COLOR_LAWNGREEN, x, y, z);
                }
                return 1;
            }
        }



Re: Need help with setting interiors. - [GOD]Dragonster82 - 21.10.2011

How about /enter? Maybe thats the main reason.


Re: Need help with setting interiors. - oshrizzz - 21.10.2011

What? What /enter has to do with it?


Re: Need help with setting interiors. - [DK]Dark_Knight - 21.10.2011

ewww yuck, please indent your code and put it in code tags,

Then we can understand/read it better


Re: Need help with setting interiors. - oshrizzz - 21.10.2011

Instead of spamming actaully read. I said I dont know the code and if some one knows it he should reply with it.


Re: Need help with setting interiors. - [DK]Dark_Knight - 21.10.2011

Код:
At the end put [/pawn]
at the start put [pawn]
Use that please


---
Код:
SPAM - Verb: Send the same message indiscriminately to recipients on the Internet
//====EDIT===//

From what you have said, and i can see, the problem doesn't lie within these commands.
Do the Properties/Businesses reload after you make them?

I don't know the gamemode, someone else will have to help you, maybe try posting in the gamemodes thread.


Re: Need help with setting interiors. - oshrizzz - 21.10.2011

Fixed, thanks.


Re: Need help with setting interiors. - System64 - 21.10.2011

give us the /enter command(If you have it)
Anything where you enter the house/bussines.... whatever


Re: Need help with setting interiors. - oshrizzz - 21.10.2011

Its the ENTER buttom. I cant find it in the script inside.
If you would download the gamemode from the creator thread, I've gave a link above. I'd really appricate that.