Long time didn't have no prob.. Please help + rep
#4

InPlayerInZone requires the zone name to be inputted as string. But why bother writing your own function if there's already one available?
pawn Код:
stock GetPlayer2DZone(playerid, zone[], len=sizeof zone) //Credits to Cueball, Betamaster, Mabako, and Simon (for finetuning).
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    for(new i = 0; i != sizeof(gSAZones); i++ )
    {
        if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
        {
            return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
        }
    }
    return 0;
}
Reply


Messages In This Thread
Long time didn't have no prob.. Please help + rep - by Scrillex - 22.03.2012, 17:09
Re: Long time didn't have no prob.. Please help + rep - by Scrillex - 22.03.2012, 17:18
Re: Long time didn't have no prob.. Please help + rep - by Twisted_Insane - 22.03.2012, 17:29
Re: Long time didn't have no prob.. Please help + rep - by Vince - 22.03.2012, 17:33

Forum Jump:


Users browsing this thread: 1 Guest(s)