Foreach include
#1

How can I replace these functions to the standard samp functions?
Without using include foreach?

Код:
Iter_Count(Test);
parametr = Iter_Random(Test2);
Iter_Remove(Test2, parametr);
Iter_Clear(Test2);
for( new i; i < MAX_PLAYERS; i++ ) Iter_Add(Test2, i);
Reply
#2

You could, but why? Just include y_iterate
Reply
#3

Код:
for( new playerid; playerid < MAX_PLAYERS;playerid++ ) Iter_Add(Test2, playerid);
Reply
#4

Quote:
Originally Posted by bigboy81
Посмотреть сообщение
Код:
for( new playerid; playerid < MAX_PLAYERS;playerid++ ) Iter_Add(Test2, playerid);
what?? Nothing really has changed

--------------

I don`t want to use this include (foreach and others from Y_Les (they seem to me difficult))
I want the normal functions of the sump.
But I found an interesting script, and then use these variables (Iter_Count Iter_Random Iter_Remove Iter_Clear Iter_Add), and I need them to change the standard, and I do not know how
Reply
#5

Although it seems to understand. Now I try
Reply
#6

Try this
#define foreach(%0) for(new %0 = 0; %0 <= GetPlayerPoolSize(); %0++) if(!IsPlayerConnected(%0)) continue;

Example :
foreach(i)
{
// code here
}
Reply
#7

Quote:
Originally Posted by ShooteR1990
Посмотреть сообщение
Try this
This will not work

You have 2 Options...you can include it..or you post more code..so that we can have a better overview
Reply
#8

All. Topic can be closed ... I realized that script without include will not work correctly
Reply
#9

Quote:
Originally Posted by ******
Посмотреть сообщение
I think the real question is: why? Foreach builds on the standard SA:MP functions, so all you are doing is asking how to recreate something that already exists in the same way as the thing that already exists. Which means a) you end up with the same thing, but b) you have to do a lot more work to get there.
In short yes) Looked code you include , now I`ll use it) Well, at the same time redoing other options .. did not think that it would be) Thank you for include
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)