[Tutorial] Using strcat(with colors)[zCmd][Random Cmd]
#1

Introduction
I'm making this tutorial because ShowPlayerDialog allows only 5-6 lines so incase someone wants more lines to add can use strcat.
(Color codes: http://html-color-codes.info/ )

(Download zCmd here: https://sampforum.blast.hk/showthread.php?tid=91354 )

Codes
First of all we need to make a (new "howyou want to name the dialog"["dialogid"] So i name it "cmdsdialog" with ID "2999"
Код:
CMD:teles(playerid,params[])//I show u how i created /teles
{
new cmdsdialog[2999];
return 1;
}
Now we have to add the messages:
Код:
CMD:teles(playerid,params[])
{
new cmdsdialog[2999];
strcat(cmdsdialog,"{EB1B1B}Red color/entertexthere\n"); // "{EB1B1B}" is the color
strcat(cmdsdialog,"{EB1B1B}Red color/entertexthere\n");//"{EB1B1B}" is the color
return 1;
}
So once you added it we should add boarder's name:
Код:
CMD:teles(playerid,params[])
{
new cmdsdialog[2999];
strcat(cmdsdialog,"{EB1B1B}Red color/entertexthere\n");//"{EB1B1B}" is the color
strcat(cmdsdialog,"{EB1B1B}Red color/entertexthere\n");//"{EB1B1B}" is the color
ShowPlayerDialog(playerid,0,0,"Player Teleports",cmdsdialog,"Okay","Close");//"Okay"is button1,"Close"is button2
return 1;
}
Something went wrong or you need help?Lemme know.
Reply
#2

Why not use format?
Reply
#3

That string length made me laugh my head off.
Reply
#4

That string length? R.I.P low-end servers.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)