help with this code
#1

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;
}
so i'm trying to do this, create an object and set the id in ascending order, like for example.. if i create an object it sets the object id to 0, so i can edit the object with another functoin, for example MoveObject with another command.. i got the code above but i doubt it's gonna work.. i tested it ig, and it sets 1 object, from 199 to 250 .. help please
Reply
#2

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)