Dynamic Dialog Items help
#1

I don't want any of the code public, please delete this thread.
Reply
#2

I don't see why that wouldn't work, just use 10 different strings if it doesn't.
Reply
#3

Quote:
Originally Posted by [HiC
TheKiller ]
I don't see why that wouldn't work, just use 10 different strings if it doesn't.
Because it add's existing characters onto the dialog, and i don't know how to detect which character name is in the first listitem, second etc because instead of it being say

Character1
(Blank listitem)
(Blank listitem)
Character4
(Blank listitem)
Character6

It will be:

Character1
Character4
Character6

Because thats the way i coded it..

Know what i mean?

My brains not fully functioning atm if i'm not explaining it correctly as it's 9am and i haven't slept yet lol.
Reply
#4

Quote:
Originally Posted by Norn
Quote:
Originally Posted by [HiC
TheKiller ]
I don't see why that wouldn't work, just use 10 different strings if it doesn't.
Because it add's existing characters onto the dialog, and i don't know how to detect which character name is in the first listitem, second etc because instead of it being say

Character1
(Blank listitem)
(Blank listitem)
Character4
(Blank listitem)
Character6

It will be:

Character1
Character4
Character6

Because thats the way i coded it..

Know what i mean?

My brains not fully functioning atm if i'm not explaining it correctly as it's 9am and i haven't slept yet lol.
strfind the name?
Reply
#5

Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by Norn
Quote:
Originally Posted by [HiC
TheKiller ]
I don't see why that wouldn't work, just use 10 different strings if it doesn't.
Because it add's existing characters onto the dialog, and i don't know how to detect which character name is in the first listitem, second etc because instead of it being say

Character1
(Blank listitem)
(Blank listitem)
Character4
(Blank listitem)
Character6

It will be:

Character1
Character4
Character6

Because thats the way i coded it..

Know what i mean?

My brains not fully functioning atm if i'm not explaining it correctly as it's 9am and i haven't slept yet lol.
strfind the name?
You don't understand, i can't because i don't know the name of the listitem a player has selected. They select a list item and click Spawn and all the characters stats load from file with the name.
Reply
#6

Quote:
Originally Posted by Norn
Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by Norn
Quote:
Originally Posted by [HiC
TheKiller ]
I don't see why that wouldn't work, just use 10 different strings if it doesn't.
Because it add's existing characters onto the dialog, and i don't know how to detect which character name is in the first listitem, second etc because instead of it being say

Character1
(Blank listitem)
(Blank listitem)
Character4
(Blank listitem)
Character6

It will be:

Character1
Character4
Character6

Because thats the way i coded it..

Know what i mean?

My brains not fully functioning atm if i'm not explaining it correctly as it's 9am and i haven't slept yet lol.
strfind the name?
You don't understand, i can't because i don't know the name of the listitem a player has selected. They select a list item and click Spawn and all the characters stats load from file with the name.
I meant when you are saving them. When you insert them into a dialog also save it into a variable E.g. Characters[10][24].
Reply
#7

Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by Norn
Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by Norn
Quote:
Originally Posted by [HiC
TheKiller ]
I don't see why that wouldn't work, just use 10 different strings if it doesn't.
Because it add's existing characters onto the dialog, and i don't know how to detect which character name is in the first listitem, second etc because instead of it being say

Character1
(Blank listitem)
(Blank listitem)
Character4
(Blank listitem)
Character6

It will be:

Character1
Character4
Character6

Because thats the way i coded it..

Know what i mean?

My brains not fully functioning atm if i'm not explaining it correctly as it's 9am and i haven't slept yet lol.
strfind the name?
You don't understand, i can't because i don't know the name of the listitem a player has selected. They select a list item and click Spawn and all the characters stats load from file with the name.
I meant when you are saving them. When you insert them into a dialog also save it into a variable E.g. Characters[10][24].
I know, but i need to know the order of the characters to be able to create a working spawn button..

I tried that before but that means i would have to check every variable to see if its empty or contains text, but apart from that i'm confused how to determine the order from the variables i stored the data in.

Going to bed now it's 10.30am and i haven't slept yet, i'll check back later.

Cheers.
Reply
#8

Bump, i'm really stuck with this.

How could i detect which player character comes first/second/third etc, i can store the %s\n%s in a global variable. Wouldn't that be easier?
Reply
#9

Removing my code.
Reply
#10

Quote:
Originally Posted by Norn
Quote:
Originally Posted by Norn
Bump, i'm really stuck with this.

How could i detect which player character comes first/second/third etc, i can store the %s\n%s in a global variable. Wouldn't that be easier?
Update:

I created this,

pawn Code:
stock GetMenuDialogCharacterOrder(playerid, characterslotid)
{
  new arrCoords[11][64], string[128];
    if(characterslotid >= 1 && characterslotid <= 10)
    {
      format(string,sizeof(string),"%s", MasterAccount[playerid][mCharacterString]);
      split(string, arrCoords, '\n');
        if(characterslotid == 1) return arrCoords[1];
        else if(characterslotid == 2) return arrCoords[2];
        else if(characterslotid == 3) return arrCoords[3];
        else if(characterslotid == 4) return arrCoords[4];
        else if(characterslotid == 5) return arrCoords[5];
        else if(characterslotid == 6) return arrCoords[6];
        else if(characterslotid == 7) return arrCoords[7];
        else if(characterslotid == 8) return arrCoords[8];
        else if(characterslotid == 9) return arrCoords[9];
        else if(characterslotid == 10) return arrCoords[10];
    }
}
and it works, but arrCoords[0] is blank and the names don't start until arrCoords[1]. Why is that?
I'm sure it would be easier to:

pawn Code:
stock GetMenuDialogCharacterOrder(playerid, characterslotid)
{
  new arrCoords[11][64], string[128];
    if(characterslotid >= 1 && characterslotid <= 10)
    {
      format(string,sizeof(string),"%s", MasterAccount[playerid][mCharacterString]);
      split(string, arrCoords, '\n');
      return arrCoords[characterslotid];
    }
}
Reply
#11

Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by Norn
Quote:
Originally Posted by Norn
Bump, i'm really stuck with this.

How could i detect which player character comes first/second/third etc, i can store the %s\n%s in a global variable. Wouldn't that be easier?
Update:

I created this,

pawn Код:
stock GetMenuDialogCharacterOrder(playerid, characterslotid)
{
  new arrCoords[11][64], string[128];
    if(characterslotid >= 1 && characterslotid <= 10)
    {
      format(string,sizeof(string),"%s", MasterAccount[playerid][mCharacterString]);
      split(string, arrCoords, '\n');
        if(characterslotid == 1) return arrCoords[1];
        else if(characterslotid == 2) return arrCoords[2];
        else if(characterslotid == 3) return arrCoords[3];
        else if(characterslotid == 4) return arrCoords[4];
        else if(characterslotid == 5) return arrCoords[5];
        else if(characterslotid == 6) return arrCoords[6];
        else if(characterslotid == 7) return arrCoords[7];
        else if(characterslotid == 8) return arrCoords[8];
        else if(characterslotid == 9) return arrCoords[9];
        else if(characterslotid == 10) return arrCoords[10];
    }
}
and it works, but arrCoords[0] is blank and the names don't start until arrCoords[1]. Why is that?
I'm sure it would be easier to:

pawn Код:
stock GetMenuDialogCharacterOrder(playerid, characterslotid)
{
  new arrCoords[11][64], string[128];
    if(characterslotid >= 1 && characterslotid <= 10)
    {
      format(string,sizeof(string),"%s", MasterAccount[playerid][mCharacterString]);
      split(string, arrCoords, '\n');
      return arrCoords[characterslotid];
    }
}
Of course, i'm just trying to get this done fast as i haven't slept in like 27 hours so i'm not thinking straight lol.

Any idea why arrCoords[0] is blank?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)