13.09.2017, 23:07
(
Последний раз редактировалось danielpalade; 25.09.2017 в 21:56.
)
-- DELETED --
new
string[128];
for(new i = sizeof(obj); i >= 0; i--)
{
format(string, sizeof(string), "This would be a descending order: %i", i);
SendClientMessage(playerid, -1, string);
}
So in a descending order?
PHP код:
|
How can I make it so when I for example type the command: /forth it will show me the objects in order? |
Let's say I have the enum objects in which I have 3 objects.
Код:
enum objects { objID, objModel } new obj[5][objects]; How can I make it so when I for example type the command: /forth it will show me the objects in order? For example: I use /forth and a message pops up and gives me the objID of the next object in queue in the enum. Let's say I use this command 3 times and I end up at the last objID which is 3. How can I make it that when I now type /back, it will give me messages with the objects in a reversed order? So again, I use /back 3 times here. First /back: objID 3 Second /back: objID 2 Thrid Back: objID 1 Let's say I stop at the second /back which is objID 2, and I type /forth one more time, it has to get me to objID 3, since objID 3 is the next in the queue. How can I make this? |
enum objects
{
objID,
objModel
}
new obj[5][objects];
new objcount;
new objforplayer[MAX_PLAYERS];
CMD:forth(playerid, params[])
{
if (objforplayer[playerid] < objcount)
{
new str[64];
format(str, sizeof str, "objID %d", obj[objforplayer[playerid]][objID]);
SendClientMessage(playerid, COLOR_GREEN, str);
objforplayer[playerid]++;
}
}
CMD:back(playerid, params[])
{
if (objforplayer[playerid] > 0)
{
objforplayer[playerid]--;
new str[64];
format(str, sizeof str, "objID %d", obj[objforplayer[playerid]][objID]);
SendClientMessage(playerid, COLOR_GREEN, str);
}
}