17.06.2017, 14:03
I am going to suggest you add some more features this is actually a good idea for a system but could be a lot better.
- You can attach objects to objects that have special properties (rotating objects) and there may be others with interesting effects (styles)
- Create update functions to set position / color / style
- Update to use iterators
- Either add an option or always to do it when teleporting https://sampwiki.blast.hk/wiki/SetCameraBehindPlayer
- An arrow editor (dialogs/admin only)
- Save created arrows to file (loadable) leave option to create them with code as well
- Why on earth would you create anything in a destroy function?
- You can safely remove all of this code it does nothing
- Your create function is written with a fatal flaw
- Do it like this DoesArrowExist() is a bad choice
- Or better yet!
If you take the time to make the changes I suggest I will have no choice but to give 5-stars as it stands now though this isn't any better that a 2-Star piece of work.
- You can attach objects to objects that have special properties (rotating objects) and there may be others with interesting effects (styles)
- Create update functions to set position / color / style
- Update to use iterators
Код:
for(new i = 0; i < MAX_ARROWS;i++) if(DoesArrowExist(i))
- An arrow editor (dialogs/admin only)
- Save created arrows to file (loadable) leave option to create them with code as well
- Why on earth would you create anything in a destroy function?
Код:
I_ARROW[arrowid][arw_areaid] = CreateDynamicSphere(-9999, -9999, -9999, -9999);
Код:
I_ARROW[arrowid][arw_posx] = -9999; I_ARROW[arrowid][arw_posy] = -9999; I_ARROW[arrowid][arw_posz] = -9999; I_ARROW[arrowid][arw_interior] = -1; I_ARROW[arrowid][arw_virtual_world] = -1;
Код:
stock CreateArrow(arrowid, playerid = -1, ARROW_COLOR, Float:x, Float:y, Float:z, interior = 0, virtual_world = 0, Float:tox, Float:toy, Float:toz, tointerior = 0, tovirtual_world = 0, Float:stream_distance) { if(DoesArrowExist(arrowid)) return printf("Arrow.inc: Arrow exist.");
Код:
stock CreateArrow(playerid = -1, ARROW_COLOR, Float:x, Float:y, Float:z, interior = 0, virtual_world = 0, Float:tox, Float:toy, Float:toz, tointerior = 0, tovirtual_world = 0, Float:stream_distance) { new index; for(index = 0; index < MAX_ARROWS; index++) { if(!I_ARROW[index][arw_exist]) break; }
Код:
stock CreateArrow(playerid = -1, ARROW_COLOR, Float:x, Float:y, Float:z, interior = 0, virtual_world = 0, Float:tox, Float:toy, Float:toz, tointerior = 0, tovirtual_world = 0, Float:stream_distance) { new index; index = Iter_Free(Arrow_Iter); if(index > -1) { Iter_Add(Arrow_Iter, index); // Code Here return index; } printf("ERROR::CreateArrow()::Array Full"); return -1; }