This could be accomplished by offsetting the players position with sin and cos variables (with changing the angle too). That way you're not just restricted to the x and y axis.
pawn Code:
new Float: x, Float: y, Float: z, Float: a;
GetPlayerPos( playerid, x, y, z );
GetPlayerFacingAngle( playerid, a );
a += random( 360 );
x += ( random( 10 ) * floatsin( -a, degrees ) );
y += ( random( 10 ) * floatcos( -a, degrees ) );
CreateObject( 0, x, y, z, 0.00, 0.00, 0.00 );
Notes:
- The random( 360) will add a random value to the angle, so it spawns at a different direction from the player
- The random( 10 ) will add a random value from the player, so they'll be at different distances, not always 5, or whatever
- If you would like a constant distance from the player, exchange random( 10 ) with the number of units you desire
- You could place this code under some type of timer