What's wrong with this?
#6

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
stock IsPlayerNearHouse(playerid) // If a player is near a house, it will return the slot else -1
{
    for(new i = 0; i < MAX_HOUSES; i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 1, HouseInfo[i][hEnterPos][0], HouseInfo[i][hEnterPos][1], HouseInfo[i][hEnterPos][2]))
        {
            return i;
        }
    }
    return -1;
}

CMD:enter(playerid, params[])
{
    new i = IsPlayerNearHouse(playerid);
    if (i != -1)
    {
        SetPlayerPos(playerid, HouseInfo[i][hExitPos][0], HouseInfo[i][hExitPos][1], HouseInfo[i][hExitPos][2]);
        SetPlayerInterior(playerid, HouseInfo[i][hInterior]);
    }
    else SendClientMessage(playerid, COLOR_RED, "Error"White": You are not near an entrance point.");
    return 1;
}
Thanks man! I get it now.
Reply


Messages In This Thread
What's wrong with this? - by AphexCCFC - 25.04.2014, 19:58
Re: What's wrong with this? - by mamorunl - 25.04.2014, 20:04
Re: What's wrong with this? - by ]Rafaellos[ - 25.04.2014, 20:04
Re: What's wrong with this? - by AphexCCFC - 25.04.2014, 20:15
Re: What's wrong with this? - by Konstantinos - 25.04.2014, 20:17
Re: What's wrong with this? - by AphexCCFC - 25.04.2014, 20:23
Re: What's wrong with this? - by Galletziz - 25.04.2014, 20:25

Forum Jump:


Users browsing this thread: 2 Guest(s)