Question with entrances
#8

Here you go mate:

pawn Код:
new Entrances[MAX_ENTRANCES][entranceEnum], Entrances_Current=-1;

forward Tunelis(tekstas[],Float:IejimasX,Float:IejimasY,Float:IejimasZ,Float:IsejimasX,Float:IsejimasY,Float:IsejimasZ,interjeras);
public Tunelis(tekstas[],Float:IejimasX,Float:IejimasY,Float:IejimasZ,Float:IsejimasX,Float:IsejimasY,Float:IsejimasZ,interjeras)
{
    new msg[256];
    format(msg,sizeof(msg),"[%s]\n[ENTER]",tekstas);
    Create3DTextLabel(msg,0x008080FF,IejimasX,IejimasY,IejimasZ,10.0, 0, 0);
    new msg1[256];
    format(msg1,sizeof(msg1),"[%s IЉĖJIMAS]\n[ENTER]",tekstas);
    Create3DTextLabel(msg1,0x008080FF,IsejimasX,IsejimasY,IsejimasZ,10.0, 0, 0);
    Entrances[Entrances_Current+1][Iejimas][0] = IejimasX;
    Entrances[Entrances_Current+1][Iejimas][1] = IejimasY;
    Entrances[Entrances_Current+1][Iejimas][2] = IejimasZ;
    Entrances[Entrances_Current+1][Iejimas][0] = IsejimasX;
    Entrances[Entrances_Current+1][Iejimas][1] = IsejimasY;
    Entrances[Entrances_Current+1][Iejimas][2] = IsejimasZ;
    Entrances[Entrances_Current+1][interjeras] = interjeras;
    print("[TUNELIAI] Uћkrauti");
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkays, oldkeys)
{
    if(newkeys & KEY_SECONDARY_ATTACK)
    {
        for(new i; i < MAX_ENTRANCES; i++) //or for(new i; i < Entrances_Current+1; i++)
        {
            if(IsPlayerInRangeOfPoint(Entrances[i][Iejimas][0], Entrances[i][Iejimas][1], Entrances[i][Iejimas][2])
            {
                SetPlayerPos(playerid, Entrances[i][Isejimas][0], Entrances[i][Isejimas][1], Entrances[i][Isejimas][2]);
                SetPlayerInterior(playerid, interjeras);
                break;
            }
            else if(IsPlayerInRangeOfPoint(Entrances[i][Isejimas][0], Entrances[i][Isejimas][1], Entrances[i][Isejimas][2])
            {
                SetPlayerPos(playerid, Entrances[i][Iejimas][0], Entrances[i][Iejimas][1], Entrances[i][Iejimas][2]);
                SetPlayerInterior(playerid, 0);
                break;
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Question with entrances - by Burning - 09.08.2014, 12:28
Re: Question with entrances - by kamiliuxliuxliux - 09.08.2014, 12:39
Re: Question with entrances - by Burning - 09.08.2014, 12:41
Re: Question with entrances - by kamiliuxliuxliux - 09.08.2014, 12:43
Re: Question with entrances - by Burning - 09.08.2014, 12:44
Re: Question with entrances - by kamiliuxliuxliux - 09.08.2014, 12:52
Re: Question with entrances - by Burning - 09.08.2014, 14:55
Re: Question with entrances - by SKAzini - 09.08.2014, 15:44

Forum Jump:


Users browsing this thread: 2 Guest(s)