17.10.2013, 13:14
(
Last edited by iFiras; 11/09/2014 at 03:14 AM.
)
Deleted.
new counter = 0, perangle = 0, players[MAX_PLAYERS]; foreach( new i: Player ) { new Float:x, Float:y, Float:z; GetPlayerPos( playerid, x, y, z); if(IsPlayerInRangeOfPoint( i, RANGE, x, y, z)) {counter++; players[i] = 1;} } if( counter != 0 ) { perangle = 360/counter; } new Float: fangle; GetPlayerFacingAngle( playerid, fangle ); for( new m = 0; m <MAX_PLAYERS; m++ ) { new temp = 0; if( players[m] == 1 ) { temp =+ 1; SetPlayerPos( m, x + RANGE * floatcos( fangle + temp*perangle, degrees ), y + RANGE*floatsin(fangle + temp*perangle, degrees), z ); ...
// function by snoob
stock GetAllHere(playerid)
{
new Float:Dpos[4];
GetPlayerPos(playerid, Dpos[0], Dpos[1], Dpos[2]);
new Dtotal;
for (new i = 0; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i)) Dtotal++;
new Float:Dangle = floatdiv(360.0, Dtotal);
new Dtick;
new Dint = GetPlayerInterior(playerid);
for (new i = 0; i<MAX_PLAYERS; i++)
{
if(i == playerid) continue;
if(IsPlayerConnected(i))
{
TogglePlayerControllable(i, false);
new Float:opp = (Dtick) ? (-Dpos[3]) : (Dpos[3]);
SetPlayerPos(i,
Dpos[0]+4.5*floatsin(opp,degrees),
Dpos[1]+4.5*floatcos(opp,degrees),
Dpos[2]);
SetPlayerInterior(playerid, Dint);
SetPlayerFacingAngle(i, floatsub(360.0, Dangle));
SetPlayerCameraPos(i,
Dpos[0]+7.5*floatsin(opp,degrees),
Dpos[1]+7.5*floatcos(opp,degrees),
Dpos[2]+5);
SetPlayerCameraLookAt(i, Dpos[0], Dpos[1], Dpos[2]);
Dpos[3] += Dangle;
if(Dtick) Dtick = 0;
else Dtick++;
}
}
return 1;
}
//Usage:
CMD:getall(playerid, params[])
{
GetAllHere(playerid);
return 1;
}