[Tutorial] Entrances and Exits: One command, one file!
#2

Err, I think you only explained how to add entrances in the .cfg file.

Double loops
pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    for(new i = 0;i < sizeof(EntranceRef);i++)
    {
        if(
            IsPlayerInRangeOfPoint(playerid,2,Entrances[i][outside_x],Entrances[i][outside_y],Entrances[i][outside_z])
            &&
            GetPlayerVirtualWorld(playerid) == Entrances[i][outside_w]
        )
        {
            GameTextForPlayer(playerid, "~w~Type ~r~/door~w~ to go inside", 5000, 5);
            return 1;
        }
    }
    for(new i = 0;i < sizeof(EntranceRef);i++)
    {
        if(
            IsPlayerInRangeOfPoint(playerid,2,Entrances[i][inside_x],Entrances[i][inside_y],Entrances[i][inside_z])
            &&
            GetPlayerVirtualWorld(playerid) == Entrances[i][inside_w]
        )
        {
            GameTextForPlayer(playerid, "~w~Type ~r~/door~w~ to go outside", 5000, 5);
            return 1;
        }
    }
    return 1;
}
Rating how do you explain : 2.5/10

Nice code though.
Reply


Messages In This Thread
Entrances and Exits: One command, one file! - by Jack_Leslie - 04.09.2011, 07:07
Re: Entrances and Exits: One command, one file! - by Basicz - 04.09.2011, 08:11
Re: Entrances and Exits: One command, one file! - by Jack_Leslie - 04.09.2011, 09:10
Re: Entrances and Exits: One command, one file! - by dowster - 04.09.2011, 22:34
Re: Entrances and Exits: One command, one file! - by Emmet_ - 06.09.2011, 07:56
Re: Entrances and Exits: One command, one file! - by Jack_Leslie - 06.09.2011, 08:15
Re: Entrances and Exits: One command, one file! - by Yamoo - 06.09.2011, 17:12
Re: Entrances and Exits: One command, one file! - by Emmet_ - 06.09.2011, 20:50
Re: Entrances and Exits: One command, one file! - by Jack_Leslie - 07.09.2011, 03:14
Re: Entrances and Exits: One command, one file! - by Ehab1911 - 29.09.2011, 18:43

Forum Jump:


Users browsing this thread: 1 Guest(s)