SA-MP Forums Archive
Dynamic Dialog Items help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dynamic Dialog Items help (/showthread.php?tid=123282)



Dynamic Dialog Items help - Norn - 25.01.2010

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


Re: Dynamic Dialog Items help - [HiC]TheKiller - 25.01.2010

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


Re: Dynamic Dialog Items help - Norn - 25.01.2010

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.


Re: Dynamic Dialog Items help - [HiC]TheKiller - 25.01.2010

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?


Re: Dynamic Dialog Items help - Norn - 25.01.2010

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.


Re: Dynamic Dialog Items help - [HiC]TheKiller - 25.01.2010

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].


Re: Dynamic Dialog Items help - Norn - 25.01.2010

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.


Re: Dynamic Dialog Items help - Norn - 25.01.2010

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?


Re: Dynamic Dialog Items help - Norn - 25.01.2010

Removing my code.


Re: Dynamic Dialog Items help - [HiC]TheKiller - 25.01.2010

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];
    }
}



Re: Dynamic Dialog Items help - Norn - 25.01.2010

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?