10.03.2012, 09:34
i'm creating create signature the problem is when ever i type or player type /createsignature
server closes
i think the problem might be here
i just want to create a signature, if the signature text pass the length 30 he or she will get the message "SYNTAX: /createsignature [text]" plus how to save the signature in word not in value i try dini_Set but the problem is when checking i don't know what to use for checking that is the problem. here is the code.
one question is this correct?
server closes
i think the problem might be here
pawn Код:
params[30]
pawn Код:
//OnDialogResponse
if(dialogid == DIALOG_EDIT)
{
if(!response) return ShowPlayerDialog(playerid, DIALOG_SETTINGS, DIALOG_STYLE_LIST, "Signature Settings", "Edit Signaturetext\nRemove Signature", "Choose", "Cancel");
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EDIT, DIALOG_STYLE_INPUT, "Signaturetext Edit", "Please type your new signature text!", "Change", "Cancel");
if(strlen(inputtext) < 30) return ShowPlayerDialog(playerid, DIALOG_EDIT, DIALOG_STYLE_INPUT, "Signaturetext Edit", "Please type your new signature text!", "Change", "Cancel");
SendClientMessage(playerid, -1, "Signature sucessfully edited!");
dini_Set(file, "Signature", inputtext); //need help about this issue
}
CMD:createsignature(playerid, params[])
{
if(sscanf(params, "s[30]", params[30])) return SendClientMessage(playerid, -1, "SYNTAX: /createsignature [text]"); //the problem might be inside here
SignInfo[playerid][Signature] = params[30]; //the problem might be here too!
if(fexist(file)) return SendClientMessage(playerid, -1, "You already create your own signature!");
SendClientMessage(playerid, -1, "Signature sucessfully created!");
dini_Create(file);
dini_Set(file, "Signature", SignInfo[playerid][Signature]);
return 1;
}
pawn Код:
CMD:mysignature(playerid, params[])
{
new string[678];
format(file, sizeof(file), "RSign/Users/%s.ini", pname(playerid));
SignInfo[playerid][Signature] = dini_Int(file, "Signature");
if(!dini_Exists(file)) return SendClientMessage(playerid, -1, "You don't create signature yet!");
format(string, sizeof(string), "%s\n", SignInfo[playerid][Signature]);
ShowPlayerDialog(playerid, DIALOG_MYSIGN, DIALOG_STYLE_MSGBOX, "My Signautre", string, "OK", "");
return 1;
}