Loops once only?
#9

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
No, no. That's the part you get confused. You can assign any number you want (-2.1 billions to 2.1 billions), but inside the [ ], you need to start from 0 to MAX_CUSTOM_WEAPONS-1.

pawn Код:
new WeaponData[MAX_CUSTOM_WEAPONS][E_WEAPON_INFO] =
{
    {"Micro-SMG", 1200, 28, 50, 352, 310.905181, -166.905059, 999.661987, -89.199905, 42.499996, 176.358154},
    {"Desert Eagle", 2000, 24, 14, 348, 312.696197, -166.850097, 999.641113, -89.799957, 0.0000, 183.354507}
};

public OnFilterScriptInit()
{
    for(new weapid = 0; weapid < 2; weapid++)
    {
        WeaponObjects[weapid] = CreateObject(WeaponData[weapid][WEAPON_MODEL], WeaponData[weapid][WEAPON_X], WeaponData[weapid][WEAPON_Y], WeaponData[weapid][WEAPON_Z], WeaponData[weapid][WEAPON_RX], WeaponData[weapid][WEAPON_RY], WeaponData[weapid][WEAPON_RZ], 300.0);
        printf("ID: %d | ID2: %d", WeaponObjects[weapid], weapid);
    }
    return true;
}
That should work fine.
I had this that way done, but the IDs are swapped. I mean, have a look:
Код:
[20:55:41] ID: 1 | ID2: 0
[20:55:41] ID: 2 | ID2: 1
What I'm doing is, checking if player is standing in 1 meter range of the object and display a message. It does work for Desert Eagle only. So, to make it work I need that like:

Код:
[20:55:41] ID: 1 | ID2: 1
[20:55:41] ID: 2 | ID2: 2
Am I right?
Reply


Messages In This Thread
Loops once only? - by Riddick94 - 11.09.2013, 18:19
Re: Loops once only? - by Macluawn - 11.09.2013, 18:39
Re: Loops once only? - by Riddick94 - 11.09.2013, 18:42
Re: Loops once only? - by Konstantinos - 11.09.2013, 18:53
Re: Loops once only? - by Riddick94 - 11.09.2013, 19:01
Re: Loops once only? - by Konstantinos - 11.09.2013, 19:10
Re: Loops once only? - by Riddick94 - 11.09.2013, 19:27
Re: Loops once only? - by Konstantinos - 11.09.2013, 19:46
Re: Loops once only? - by Riddick94 - 11.09.2013, 19:55
Re: Loops once only? - by Konstantinos - 11.09.2013, 20:00

Forum Jump:


Users browsing this thread: 1 Guest(s)