Need help with textdraw and enums.
#1

-- DELETED --
Reply
#2

So in a descending order?

PHP код:
new
    
string[128];
    
for(new 
sizeof(obj); >= 0i--)
{
    
format(stringsizeof(string), "This would be a descending order: %i"i);
    
SendClientMessage(playerid, -1string); 

Is one way.
Reply
#3

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
So in a descending order?

PHP код:
new
    
string[128];
    
for(new 
sizeof(obj); >= 0i--)
{
    
format(stringsizeof(string), "This would be a descending order: %i"i);
    
SendClientMessage(playerid, -1string); 

Is one way.
No loop...

-----

Create an array such as pCount[MAX_PLAYERS] then use it to keep count of the object you're on.
Reply
#4

Quote:

How can I make it so when I for example type the command: /forth it will show me the objects in order?

Did I misunderstand him OR?
Reply
#5

Quote:
Originally Posted by danielpalade
Посмотреть сообщение
Let's say I have the enum objects in which I have 3 objects.

Код:
enum objects
{
	objID,
	objModel
}
new obj[5][objects];
There are 3 objects currently stored in the enum.

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?
PHP код:
enum objects
{
    
objID,
    
objModel
}
new 
obj[5][objects];
new 
objcount;
new 
objforplayer[MAX_PLAYERS];
CMD:forth(playeridparams[])
{
    if (
objforplayer[playerid] < objcount)
    {
        new 
str[64];
        
format(strsizeof str"objID %d"obj[objforplayer[playerid]][objID]);
        
SendClientMessage(playeridCOLOR_GREENstr);
        
objforplayer[playerid]++;
    }
}
CMD:back(playeridparams[])
{
    if (
objforplayer[playerid] > 0)
    {
        
objforplayer[playerid]--;
        new 
str[64];
        
format(strsizeof str"objID %d"obj[objforplayer[playerid]][objID]);
        
SendClientMessage(playeridCOLOR_GREENstr);
    }

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)