Repeat
#1

Hello everyone , today i've made a new commands dialog and i have 1 problem .
When I type firts /cmds all goes fine , but if i type again the dialog opens and after text finish it repeats again the text from beggining .

This is the code
Код:
CommandDialog()
{
    strcat(Commands, "{FF0202}->/car [name]{EFED7A} foloseste {FF0202}/car [name]{EFED7A} pentru a lua masina dorita\n", 1024 );
    strcat(Commands, "{FF0202}->/teles{EFED7A} foloseste {FF0202}/teles {EFED7A}pentru a vedea toate teleporturile\n", 1024 );
    strcat(Commands, "{FF0202}->/vcontrol{EFED7A} foloseste {FF0202}/vcontrol {EFED7A}pentru a accesa Vehicle Control\n\n", 1024 );
    strcat(Commands, "{FDFF66}/flipc /healme /credits /rules /cc /count\n", 1024 );
    strcat(Commands, "{FDFF66}/godon /godoff /skin <id> /vcontrol /godlist\n", 1024 );
    strcat(Commands, "{FDFF66}/godcar /cash /culori /zi /noapte /nrg /fixcar\n", 1024 );
    strcat(Commands, "{FDFF66}/bug /speedo /savep /loadp /sprunk /beer /smoke\n", 1024 );
    strcat(Commands, "{FDFF66}/rampages /pgoto <id> /vcmds /cmds /ponline\n", 1024 );
    strcat(Commands, "{FDFF66}/vup /vupoff /hold /getwet /myhealth /tagsoff\n", 1024 );
    strcat(Commands, "{FDFF66}/tagson /neon /hidetele\n\n", 1024 );
    strcat(Commands, "Apasa {FC0303}2 {FDFF66}pentru a repara masina si apasa {FC0303}CLICK {FDFF66}pentru a adauga nitro!", 1024 );
    return Commands;
}
And /cmds command
Код:
COMMAND:cmds( playerid, params[ ] )
    {
	ShowPlayerDialog( playerid, 9046, DIALOG_STYLE_MSGBOX,"Comenzi", CommandDialog(), "Ok", "Close" );
    }
Whats wrong ?
Reply
#2

put all strcat in ongamemodeinit
then in dialog put only ,Commands,
if u call some times the strcat they add a new strcat every time
so u call it only in gamemodeinit !
Reply
#3

try this:

pawn Код:
CommandDialog()
{
    Commands[0]='\0';
    strcat(Commands, "{FF0202}->/car [name]{EFED7A} foloseste {FF0202}/car [name]{EFED7A} pentru a lua masina dorita\n", 1024 );
    strcat(Commands, "{FF0202}->/teles{EFED7A} foloseste {FF0202}/teles {EFED7A}pentru a vedea toate teleporturile\n", 1024 );
    strcat(Commands, "{FF0202}->/vcontrol{EFED7A} foloseste {FF0202}/vcontrol {EFED7A}pentru a accesa Vehicle Control\n\n", 1024 );
    strcat(Commands, "{FDFF66}/flipc /healme /credits /rules /cc /count\n", 1024 );
    strcat(Commands, "{FDFF66}/godon /godoff /skin <id> /vcontrol /godlist\n", 1024 );
    strcat(Commands, "{FDFF66}/godcar /cash /culori /zi /noapte /nrg /fixcar\n", 1024 );
    strcat(Commands, "{FDFF66}/bug /speedo /savep /loadp /sprunk /beer /smoke\n", 1024 );
    strcat(Commands, "{FDFF66}/rampages /pgoto <id> /vcmds /cmds /ponline\n", 1024 );
    strcat(Commands, "{FDFF66}/vup /vupoff /hold /getwet /myhealth /tagsoff\n", 1024 );
    strcat(Commands, "{FDFF66}/tagson /neon /hidetele\n\n", 1024 );
    strcat(Commands, "Apasa {FC0303}2 {FDFF66}pentru a repara masina si apasa {FC0303}CLICK {FDFF66}pentru a adauga nitro!", 1024 );
    return Commands;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)