03.09.2017, 18:07
Problem: I've built a command to spawn objects in a circle around the player (for testing). However above 50 objects (player count/spawn) a gap appears in the circle. Is my math wrong, or is there an underlying limitation in SAMP?
RESOLUTION: I changed this line and now the circle works perfectly:

RESOLUTION: I changed this line and now the circle works perfectly:
PHP код:
new Float:a = float(360)/float(count);

PHP код:
CMD:mtest(playerid, params[])
{
if(pInfo[playerid][pAdmin] < 5) return SCM(playerid, COLOR_GREY, "ERROR: You don't have access to this command, sorry.");
new Float:x, Float:y, Float:z, count, spawn;
if(sscanf(params, "ii", count, spawn))
{
SCM(playerid, COLOR_WHITE, "USE: /mtest [player count] [spawn distance]");
SCM(playerid, COLOR_YELLOW, "WARNING: This command uses open parameters, so be careful.");
return 1;
}
new Float:a = 360/count;
for(new i=0; i<count; i++)
{
GetPlayerPos(playerid, x, y, z);
new Float:a2 = a*(i+1);
x += (spawn * floatsin(-a2, degrees));
y += (spawn * floatcos(-a2, degrees));
CreateDynamicObject(13646, x, y, z-1, 0, 0, (-(a*i)+180));
}
new str[128];
format(str, sizeof(str), "[%s] %s (%i) has created a map test.", GetAdminLevelName(pInfo[playerid][pAdmin]), GetName(playerid), playerid);
CallLocalFunction("AdminMessage", "si", str, COLOR_RED);
return 1;
}