30.10.2010, 21:56
(
Последний раз редактировалось iAlexX; 30.10.2010 в 22:14.
)
Hai,
I've been brave and had an attempt to create an organization system. I've basicly got it up as a dialog, and when I type "/createorg", a dialog opens up, I have to type in that dialog the organization name.
Then I have set it so it saves the organization name in a file, but I don't know how to get the name, i've tried "inputtext" but that doesnt work.
Hes my code.
/createorg command
Heres the dialog response
I do have "Enums" but there is only one.
If you see where it says "HERE" next to "dini_IntSet(oFile, "Organization Name", pOrganization[playerid][Name]". How do I make it so the line saves as the organization name.
I've been brave and had an attempt to create an organization system. I've basicly got it up as a dialog, and when I type "/createorg", a dialog opens up, I have to type in that dialog the organization name.
Then I have set it so it saves the organization name in a file, but I don't know how to get the name, i've tried "inputtext" but that doesnt work.
Hes my code.
/createorg command
pawn Код:
dcmd_createorg(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] < 4) return 0;
{
ShowPlayerDialog(playerid, DIALOG_CREATEORG, DIALOG_STYLE_INPUT, "Organization Creation | Name", "Please enter the new organization name", "Next", "Close");
}
#pragma unused params
return 1;
}
pawn Код:
if(dialogid == DIALOG_CREATEORG)
{
new oFile[128];
format(oFile, sizeof(oFile), OrganizationLocation, inputtext);
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid, DIALOG_CREATEORG, DIALOG_STYLE_INPUT, "Organization Creation | Name", "Please enter the new organization name", "Next", "Close");
SendClientMessage(playerid, COLOR_RED, "~ You need to choose an organization name.");
}
if(dini_Exists(inputtext))
{
ShowPlayerDialog(playerid, DIALOG_CREATEORG, DIALOG_STYLE_INPUT, "Organization Creation | Name", "Please enter the new organization name", "Next", "Close");
SendClientMessage(playerid, COLOR_RED, "~ There is already an organization with this name.");
}
if(!dini_Exists(inputtext))
{
dini_Create(inputtext);
dini_IntSet(oFile, "Organization Name", pOrganization[playerid][Name] = HERE);
}
}
If you see where it says "HERE" next to "dini_IntSet(oFile, "Organization Name", pOrganization[playerid][Name]". How do I make it so the line saves as the organization name.