10.04.2017, 19:54
Uh, try creating the function this way...
SetCharName(playerid, firstname, lastname)
{
put your save code in here and use firstname to save the first name and lastname to save the last name.
}
And then after you save both variables just call the function this way
SetCharName(playerid, firstnamevar, lastnamevar);
Like.. lets say that you use first dialog for firstname
save what the player entered in a variable
and then show the second dialog, save what he entered in another variable, or use a 2d
And when you call the function
the code that is under that function will run, you will probably put the save code there.
So if you've made the function this way
then you will use firstname to save name[0] which is jack, and lastname to save name[1] which is Rickman
and to combine them just use
SetCharName(playerid, firstname, lastname)
{
put your save code in here and use firstname to save the first name and lastname to save the last name.
}
And then after you save both variables just call the function this way
SetCharName(playerid, firstnamevar, lastnamevar);
Like.. lets say that you use first dialog for firstname
save what the player entered in a variable
PHP код:
new name[2];
name[0] = "Jack";
PHP код:
name[1] = "Rickman"
PHP код:
SetCharName(playerid, name[0], name[1]);
So if you've made the function this way
PHP код:
SetCharName(playerid, firstname, lastname)
and to combine them just use
PHP код:
format(string, sizeof(string), "%s_%s", firstname, lastname);
inside the function