SA-MP Forums Archive
Nice way to make entrances? - 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: Nice way to make entrances? (/showthread.php?tid=225536)



Nice way to make entrances? - ajwar - 13.02.2011

Hi, i wan't to make entrances. I have function which check's if player is in entrance.

pawn Код:
stock IsEntrance(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 7.0, HOTEL))
    {
        // bla bla bla
        return 1;
    }
    else if(IsPlayerInRangeOfPoint(playerid, 7.0, BANK))
    {
        // bla bla bla
        return 1;
    }
    // here is more checks
    return 1;

}
And i have a lot's of coordinates:

pawn Код:
#define BANK                                                    -2173.61,679.821,55.1645
#define HOTEL                                                       -1605.5,711.163,13.8672
...
...
...
Feel free to suggest a nice and best way to make entrances. Is it possible to use case in this situation?


Re: Nice way to make entrances? - park4bmx - 13.02.2011

if i were you i would use CASE i find it easier for bigger amounts


Re: Nice way to make entrances? - ajwar - 13.02.2011

Can you show me how to use CASE in this code?


Re: Nice way to make entrances? - ajwar - 14.02.2011

Can someone show how to make the topic code in to case's?


Re: Nice way to make entrances? - iggy1 - 14.02.2011

You can't use cases in the code you posted. They are either in range or not. You would need the function to pass the entrance id, then switch that. (which isn't what you want) Stick with the code your using. You could consider using checkpoints or pickups they would make it alot easier and probably alot more efficient than range checking.


Re: Nice way to make entrances? - park4bmx - 14.02.2011

Quote:
Originally Posted by iggy1
Посмотреть сообщение
You can't use cases in the code you posted. They are either in range or not. You would need the function to pass the entrance id, then switch that. (which isn't what you want) Stick with the code your using. You could consider using checkpoints or pickups they would make it alot easier and probably alot more efficient than range checking.
yeah i was wrong i forgot u cant use CASE on rangeofpoint


Re: Nice way to make entrances? - ajwar - 14.02.2011

Any tutorial or idea's how can i make entries with SHIFT button? I need a function...