Nice way to make entrances?
#1

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?
Reply
#2

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

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

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

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.
Reply
#6

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
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)