Incite on an obstacle please
#1

I've started working on my business system. Below is the format for creating a business:
pawn Код:
/createbiz [name] [interior id] [type] [price]
I'm stumped, though, because I can't think of a (good) way to retrieve the exit coords once the player specified the interior id. I was going to create a stock which would return the coords for the given ID (based off the wiki) except, as you most likely know, some interiors share the same universe ID.

I tried looking at some other systems but that didn't help out very much.

One idea I had was to assign a custom ID to each set of exit coordinates on the wiki, and have the player choose from the custom ID set when creating a business, instead of the default ones. But that would be a long and confusing task, there surely has to be an easier method. Ideas, anyone?
Reply
#2

I don't really get what the problem is. Are virtual worlds the thing you're having troubles with, or what? I understand that it has something to do with interiors and their exits, but I can't really catch what. Please try to explain deeper.
Reply
#3

Here is a list of each interior, its ID, and the coordinates. http://weedarr.wikidot.com/interior

I need to think of an efficient way to retrieve the coordinates for any given interior ID. This way, when I create a business and set its interior, the system will know what coords to save and where to send the player when they use /enter.
Reply
#4

U need yourself make the list! You can do it by a Multi Dimensional array and assigning values to each element.
Reply
#5

Okay, well I went along with my original idea. Rather than inputting the default SA:MP interior IDs in the /createbiz, the admin would enter one of my custom IDs (1-34). With the combination of the stock functions I made below I was able to get my system up and going.

pawn Код:
stock GetDefaultInteriorID(customintid)
{
    new res;
    switch(customintid) {
        case 1: res=17;//                  24/7 1
        case 2: res=10;//                  24/7 2
        case 3: res=18;//                  24/7 3
        case 4: res=16;//                  24/7 4
        case 5: res=4;//                  24/7 5
        case 6: res=6;//                  24/7 6
        case 7: res=14;//                 didier sachs
        case 8: res=3;//                 prolaps
        case 9: res=1;//                 suburban
        case 10: res=15;//                binco
        case 11: res=5;//                 victim
        case 12: res=18;//                zip
        case 13: res=14;//                didier sachs
        case 14: res=1;//                 suburban
        case 15: res=17;//                alhambra
        case 16: res=11;//                 bar
        case 17: res=18;//                    lil probe inn
        case 18: res=3;//                     big spread ranch
        case 19: res=2;//                     strip club
        case 20: res=3;//                     pleasure domes
        case 21: res=1;//                     caligulas casino
        case 22: res=12;//                    casino
        case 23: res=10;//                    four dragons casino
        case 24: res=1;//                           ammunation 1
        case 25: res=4;//                           ammunation 2
        case 26: res=6;//                           ammunation 3
        case 27: res=7;//                           ammunation 4
        case 28: res=6;//                           ammunation 5
        case 29: res=7;//                           ammunation booths
        case 30: res=10;//                          burger shot
        case 31: res=9;//                           cluckin bell
        case 32: res=5;//                           well stacked pizza
        case 33: res=17;//                          rusty brown's donuts
        case 34: res=1;//                           liberty city diner
    }
    return res;
}
forward Float:GetInteriorZCoord(customintid);
stock Float:GetInteriorZCoord(customintid)
{
    new Float:res;
    switch(customintid) {
        case 1: res=1003.546875;//                  24/7 1
        case 2: res=1003.549438;//                  24/7 2
        case 3: res=1003.546875;//                  24/7 3
        case 4: res=1003.546875;//                  24/7 4
        case 5: res=1003.557250;//                  24/7 5
        case 6: res=1003.546875;//                  24/7 6
        case 7: res=1000.523437;//                  didier sachs
        case 8: res=1003.507812;//                  prolaps
        case 9: res=1001.804687;//                  suburban
        case 10: res=1005.132812;//                 binco
        case 11: res=1002.210937;//                 victim
        case 12: res=1001.804687;//                 zip
        case 13: res=1000.523437;//                 didier sachs
        case 14: res=1001.804687;//                 suburban
        case 15: res=1000.679687;//                 alhambra
        case 16: res=998.757812;//                  bar
        case 17: res=27.765625;//                   lil probe inn
        case 18: res=1000.953125;//                 big spread ranch
        case 19: res=1000.921875;//                 strip club
        case 20: res=906.460937;//                  pleasure domes
        case 21: res=1011.7632;//                   caligulas casino
        case 22: res=1002.0859;//                   casino
        case 23: res=996.8750;//                    four dragons casino
        case 24: res=1001.515625;//                 ammunation 1
        case 25: res=1001.515625;//                 ammunation 2
        case 26: res=1001.515625;//                 ammunation 3
        case 27: res=999.601562;//                  ammunation 4
        case 28: res=999.593750;//                  ammunation 5
        case 29: res=1004.062500;//                 ammunation booths
        case 30: res=1001.507812;//                 burger shot
        case 31: res=1001.858886;//                 cluckin bell
        case 32: res=1001.499511;//                 well stacked pizza
        case 33: res=1000.632812;//                 rusty brown's donuts
        case 34: res=1376.195312;//                 liberty city diner
    }
    return res;
}
forward Float:GetInteriorYCoord(customintid);
stock Float:GetInteriorYCoord(customintid)
{
    new Float:res;
    switch(customintid) {
        case 1: res=-185.868988;//                   24/7 1
        case 2: res=-29.271898;//                    24/7 2
        case 3: res=-89.609596;//                    24/7 3
        case 4: res=-139.066986;//                   24/7 4
        case 5: res=-29.277599;//                    24/7 5
        case 6: res=-55.714897;//                    24/7 6
        case 7: res=-166.694992;//                    didier sachs
        case 8: res=-138.804992;//                   prolaps
        case 9: res=-48.492397;//                    suburban
        case 10: res=-109.019996;//                  binco
        case 11: res=-7.431529;//                    victim
        case 12: res=-93.159156;//                   zip
        case 13: res=-166.694992;//                  didier sachs
        case 14: res=-48.492397;//                   suburban
        case 15: res=-22.722799;//                   alhambra
        case 16: res=-69.150199;//                   bar
        case 17: res=1401.229980;//                  lil probe inn
        case 18: res=-28.663099;//                   big spread ranch
        case 19: res=-11.586799;//                   strip club
        case 20: res=1406.682006;//                  pleasure domes
        case 21: res=1712.2303;//                    caligulas casino
        case 22: res=-10.2737;//                      casino
        case 23: res=1017.7790;//                    four dragons casino
        case 24: res=-40.644397;//                   ammunation 1
        case 25: res=-82.547599;//                   ammunation 2
        case 26: res=-108.071998;//                  ammunation 3
        case 27: res=-141.431991;//                  ammunation 4
        case 28: res=-167.706985;//                  ammunation 5
        case 29: res=-143.139099;//                  ammunation booths
        case 30: res=-65.816848;//                   burger shot
        case 31: res=-4.487294;//                    cluckin bell
        case 32: res=-117.270904;//                  well stacked pizza
        case 33: res=-188.803024;//                  rusty brown's donuts
        case 34: res=497.738037;//                   liberty city diner
    }
    return res;
}
forward Float:GetInteriorXCoord(customintid);
stock Float:GetInteriorXCoord(customintid)
{
    new Float:res;
    switch(customintid) {
        case 1: res=-25.884498;//                    24/7 1
        case 2: res=6.091179;//                      24/7 2
        case 3: res=-30.946699;//                    24/7 3
        case 4: res=-25.132598;//                    24/7 4
        case 5: res=-27.312299;//                    24/7 5
        case 6: res=-26.691598;//                    24/7 6
        case 7: res=204.332992;//                    didier sachs
        case 8: res=207.054992;//                    prolaps
        case 9: res=203.777999;//                    suburban
        case 10: res=207.737991;//                   binco
        case 11: res=226.293991;//                   victim
        case 12: res=161.391006;//                   zip
        case 13: res=204.332992;//                   didier sachs
        case 14: res=203.777999;//                   suburban
        case 15: res=493.390991;//                   alhambra
        case 16: res=501.980987;//                   bar
        case 17: res=-227.027999;//                  lil probe inn
        case 18: res=1212.019897;//                  big spread ranch
        case 19: res=1204.809936;//                  strip club
        case 20: res=-2640.762939;//                 pleasure domes
        case 21: res=2233.8032;//                    caligulas casino
        case 22: res=1118.8878;//                    casino
        case 23: res=2016.2699;//                    four dragons casino
        case 24: res=286.148986;//                   ammunation 1
        case 25: res=286.800994;//                   ammunation 2
        case 26: res=296.919982;//                   ammunation 3
        case 27: res=314.820983;//                   ammunation 4
        case 28: res=316.524993;//                   ammunation 5
        case 29: res=302.292877;//                   ammunation booths
        case 30: res=375.962463;//                   burger shot
        case 31: res=369.579528;//                   cluckin bell
        case 32: res=373.825653;//                   well stacked pizza
        case 33: res=381.169189;//                   rusty brown's donuts
        case 34: res=-794.806396;//                  liberty city diner
    }
    return res;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)