how to increase id number per create?
#5

Ah I see what you are trying to do there,

Код:
new idx; // Somewhere on top of your script
CMD:cdoor(playerid,params[])
{
    new string[200];
    GetPlayerPos(playerid, DoorInfo[idx][dXe], DoorInfo[idx][dYe], DoorInfo[idx][dZe]);
    DoorInfo[idx][dIe] = GetPlayerInterior(playerid);
    DoorInfo[idx][dVe] = GetPlayerVirtualWorld(playerid);
    GetPlayerFacingAngle(playerid, DoorInfo[idx][dAi]);
    // Creating the door
    CreateDynamicPickup(19198, 1, DoorInfo[idx][dXe], DoorInfo[idx][dYe], DoorInfo[idx][dZe]+0.3, DoorInfo[idx][dVe], DoorInfo[idx][dIe]);
    format(string, sizeof(string), "ID: %d",idx);
    CreateDynamic3DTextLabel(string,-1, DoorInfo[idx][dXe]-0.1, DoorInfo[idx][dYe], DoorInfo[idx][dZe]+0.5, 15);
    idx ++;
    return 1;
}
You need to make the 'idx' variable global, basically what you were doing there that you made a loop, to create x amount of doors at the same position. I don't see why you needed the loop there
Reply


Messages In This Thread
how to increase id number per create? - by drichie - 30.06.2013, 11:03
Re: how to increase id number per create? - by Macluawn - 30.06.2013, 11:05
Re: how to increase id number per create? - by WooTFTW - 30.06.2013, 11:09
Re: how to increase id number per create? - by drichie - 30.06.2013, 11:20
Re: how to increase id number per create? - by WooTFTW - 30.06.2013, 11:25
Re: how to increase id number per create? - by drichie - 30.06.2013, 11:35
Re: how to increase id number per create? - by Macluawn - 30.06.2013, 11:39
Re: how to increase id number per create? - by WooTFTW - 30.06.2013, 11:42
Re: how to increase id number per create? - by Universal - 30.06.2013, 11:52
Re: how to increase id number per create? - by Macluawn - 30.06.2013, 12:39

Forum Jump:


Users browsing this thread: 1 Guest(s)