10/06/2022 18:06
Código:
#define iRand(%1,%2) (random(%2-%1)+%1)
#define fRand(%1,%2) iRand(floatround(%1),floatround(%2))
stock SpawnPlayerInArea(playerid, team, skin, STREAMER_TAG_AREA:areaid, Float:angle, weapon1, weapon2, weapon3, ammo1, ammo2, ammo3)
{
new Float:area_x[3], Float:area_y[3], Float:area_z;
Streamer_GetFloatData(STREAMER_TYPE_AREA, areaid, E_STREAMER_MIN_X, area_x[0]);
Streamer_GetFloatData(STREAMER_TYPE_AREA, areaid, E_STREAMER_MAX_X, area_x[1]);
Streamer_GetFloatData(STREAMER_TYPE_AREA, areaid, E_STREAMER_MIN_Y, area_y[0]);
Streamer_GetFloatData(STREAMER_TYPE_AREA, areaid, E_STREAMER_MAX_Y, area_y[1]);
area_x[2] = fRand(area_x[0], area_x[1]);
area_y[2] = fRand(area_y[0], area_y[1]);
MapAndreas_FindZ_For2DCoord(area_x[2], area_y[2], area_z);
SetSpawnInfo(playerid, team, skin, area_x[2], area_y[2], area_z, 0.0, weapon1, ammo1, weapon2, ammo2, weapon3, ammo3);
return SpawnPlayer(playerid);
}