Spawn random around the player
#5

Quote:
Originally Posted by park4bmx
View Post
then do something like this
pawn Code:
new Float: x[MAX_PLAYERS], Float: y[MAX_PLAYERS], Float: z[MAX_PLAYERS], Float: a[MAX_PLAYERS];
//so it would be for a player each

//then
if(TEAM_A){//blablabla
GetPlayerPos( playerid, x[playerid], y[playerid], z[playerid]);
GetPlayerFacingAngle( playerid, a[playerid]);
a[playerid] += random( 360 );
x[playerid] += ( random( 10 ) * floatsin( -a[playerid], degrees ) );
y[playerid] += ( random( 10 ) * floatcos( -a[playerid], degrees ) );
CreateObject( 0, x[playerid], y[playerid], z[playerid], 0.00, 0.00, 0.00 );
}
no that doesnt work.

I need a code that randomly gets a player id at that team, and the player needs to be alive
Reply


Messages In This Thread
Spawn random around the player - by DaneAMattie - 18.07.2011, 10:42
Re: Spawn random around the player - by Bakr - 18.07.2011, 10:51
Re: Spawn random around the player - by DaneAMattie - 18.07.2011, 13:44
Re: Spawn random around the player - by park4bmx - 18.07.2011, 14:54
Re: Spawn random around the player - by DaneAMattie - 18.07.2011, 15:36

Forum Jump:


Users browsing this thread: 1 Guest(s)