27.08.2013, 01:18
pawn Код:
#define MAX_OBJECT_CREATED 35
new oCreated[MAX_OBJECT_CREATED];
CMD:createo(playerid, params[])
{
new objectid;
for(new i=0; i < MAX_OBJECT_CREATED; i++)
{
if(pInfo[playerid][level] < 5) return SendClientMessage(playerid, ORANGE, "You're not a level 5 admin.");
if(sscanf(params, "i", objectid)) return SendClientMessage(playerid, -1, "USAGE: /createo [object id]");
new Float:pos[4];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerFacingAngle(playerid, pos[3]);
pos[0] += (3 * floatsin(-pos[3], degrees));
pos[1] += (3 * floatcos(-pos[3], degrees));
oCreated[i]++;
oCreated[i] = CreateObject(objectid, pos[0], pos[1], pos[2], 0.0, 0.0, 0.0, 100.0);
format(ssstring, SOS, "[CREATED] Object id %d, Slot: %d, Position X: %f, Position Y: %f, Position Z: %f, Angle: %f", objectid, oCreated[i], pos[0], pos[1], pos[2], pos[3]);
SendClientMessage(playerid, YELLOW, ssstring);
}
return 1;
}