Another Thing!
#1

I need a help about formats.
pawn Код:
if(pInfo[playerid][ach1] == 1)
    {
    format(string,1000,"{00FF00}First Cigarette",acheivement());
    }
    if(pInfo[playerid][ach1] == 0)
    {
    format(string,1000,"{FFFFFF}First Cigarette",acheivement());
    }
    ShowPlayerDialog(playerid,92728,DIALOG_STYLE_LIST,"Acheivements",string,"OK","");
    }
I want to make more formats like this, that appears in the dialog, can you tell me how to adjust many formats with same string in a dialog?
Pleaze help me with it..
Reply
#2

pawn Код:
if(pInfo[playerid][ach1] == 1)
    {
    format(string,sizeof(string),"{00FF00}First Cigarette",acheivement());
     ShowPlayerDialog(playerid,92728,DIALOG_STYLE_LIST,"Acheivements",string,"OK","");
    }
    if(pInfo[playerid][ach1] == 0)
    {
    format(string,sizeof(string),"{FFFFFF}First Cigarette",acheivement());
    ShowPlayerDialog(playerid,92728,DIALOG_STYLE_LIST,"Acheivements",string,"OK","");
    }
Now what's wrong with it?
Or you can also use "strcat" for string formatting since formatting using format function is very bad and i do not recommend it.
Reply
#3

Show the function 'acheivement'
Reply
#4

Nothing, is wrong, I mean to say that
pawn Код:
if(pInfo[playerid][ach1] == 1)
    {
    format(string,1000,"{00FF00}First Cigarette",acheivement());
    }
    if(pInfo[playerid][ach1] == 0)
    {
    format(string,1000,"{FFFFFF}First Cigarette",acheivement());
    }
    if(pInfo[playerid][ach2] == 1)
    {
    format(string,1000,"{FFFFFF}First Vehicle",acheivement());
    }
if(pInfo[playerid][ach2] == 0)
    {
    format(string,1000,"{FFFFFF}First Vehicle",acheivement());
    }
    ShowPlayerDialog(playerid,92728,DIALOG_STYLE_LIST,"Acheivements",string,"OK","");
    }
I wrote that full code but the only text appear in the dialog is "First Cigarette", it doesnt appear "First Vehicle".
That is the problem.
Reply
#5

pawn Код:
stock acheivement()
{
new string2[140];
if(pInfo[playerid][ach2] == 1)
{
format(string2,sizeof(string2),"{00FF00}FirstMan");
}
if(pInfo[playerid][ach2] == 0)
{
format(string2,sizeof(string2),"{FFFFFF}FirstMan");
}
return 1;
}
Reply
#6

Your code is very confusing ...
pawn Код:
if(pInfo[playerid][ach1] == 1)
    format(string,256,"%s\n {00FF00}First Cigarette",string);
if(pInfo[playerid][ach1] == 0)
    format(string,256,"%s\n {FFFFFF}First Cigarette",string);
if(pInfo[playerid][ach2] == 1)
    format(string,256,"%s\n {FFFFFF}First Vehicle",string);
if(pInfo[playerid][ach2] == 0)
    format(string,256,"%s\n {FFFFFF}First Vehicle",string);

ShowPlayerDialog(playerid,92728,DIALOG_STYLE_LIST,"Acheivements",string,"OK","");

acheivement()
{
    new string2[20];
    if(pInfo[playerid][ach2] == 0)
        format(string2,sizeof(string2),"{FFFFFF}FirstMan");
    if(pInfo[playerid][ach2] == 1)
        format(string2,sizeof(string2),"{00FF00}FirstMan");

    return string2;
}
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)