12.11.2013, 06:56
I need that AT400 command.... if we go to under a at400 and type /at400 than we enter the at400.
CMD:at400(playerid, params[])
{
new Float: vPos[3];
for(new v = 1; v < MAX_VEHICLES; v++)
{
if(GetVehicleModel(v) != 577) continue;
GetVehiclePos(v, vPos[0], vPos[1], vPos[2]);
if(IsPlayerInSphere(playerid, vPos[0], vPos[1], vPos[2], 10)) // 10 is the distance
{
PutPlayerInVehicle(playerid, v, 0);
}
}
return 1;
}
stock GetPlayerDistanceToPointEx(playerid, Float: sx, Float: sy, Float: sz) // Sacky
{
new Float:x1,Float:y1,Float:z1;
new Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z1);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(sx,x1)),2)+floatpower(floatabs(floatsub(sy,y1)),2)+floatpower(floatabs(floatsub(sz,z1)),2));
return floatround(tmpdis);
}
stock IsPlayerInSphere(playerid, Float:sx, Float:sy, Float:sz, sradius) // Sacky
{
if(GetPlayerDistanceToPointEx(playerid, sx, sy, sz) < sradius) return 1;
return 0;
}