SetPlayerCheckpoint
#6

pawn Код:
stock GetClosestCheckpoint(playerid)
{
    //new Float:dis = 20.0;
    new Float:tmpdis;
    new cpid = 0;
    for(new i = 0; i < sizeof(HouseInfo); i++)
    {
            GetDistanceToPoint(playerid,HouseInfo[i][h_cpx], HouseInfo[i][h_cpy], HouseInfo[i][h_cpz],tmpdis);
            if(tmpdis < HouseInfo[i][h_cp_radius])
            {
                //dis = tmpdis;
                cpid = i;
            }
    }
    return cpid;
}
pawn Код:
stock GetDistanceToPoint(playerid,Float:x,Float:y,Float:z,&Float:dis)
{
    new Float:x1,Float:y1,Float:z1;
    GetPlayerPos(playerid,x1,y1,z1);
    dis=floatsqroot(floatpower(floatabs(floatsub(x,x1)),2)+floatpower(floatabs(floatsub(y,y1)),2)+floatpower(floatabs(floatsub(z,z1)),2));
    return 1;
}
some other stocks that i used in it
Reply


Messages In This Thread
SetPlayerCheckpoint - by AroseKhanNiazi - 20.05.2014, 14:50
Re: SetPlayerCheckpoint - by AroseKhanNiazi - 21.05.2014, 03:26
Re: SetPlayerCheckpoint - by Threshold - 21.05.2014, 04:39
Re: SetPlayerCheckpoint - by AroseKhanNiazi - 21.05.2014, 05:09
Re: SetPlayerCheckpoint - by MacT - 21.05.2014, 05:21
Re: SetPlayerCheckpoint - by AroseKhanNiazi - 21.05.2014, 05:37
Re: SetPlayerCheckpoint - by Threshold - 22.05.2014, 09:37
Re: SetPlayerCheckpoint - by AroseKhanNiazi - 22.05.2014, 09:54
Re: SetPlayerCheckpoint - by Threshold - 22.05.2014, 11:00
Re: SetPlayerCheckpoint - by AroseKhanNiazi - 22.05.2014, 11:15

Forum Jump:


Users browsing this thread: 1 Guest(s)