Server Console Close after /createsignature
#1

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

pawn Код:
params[30]
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.

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;
}
one question is this correct?

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;
}
Reply
#2

Yes it is the params[30]
You have to use just: params
Reply
#3

one question how to check if the text righten is pass from length 30 example

"12345678912345678912345678912355" <<< This word is in length 32 how to check something like that?

now i get error

error 006: must be assigned to an array

line 89: SignInfo[playerid][Signature] = params;
Reply
#4

pawn Код:
if(strlen(params) > 30) // strlen = string length
Reply
#5

thanks now my problem is this

pawn Код:
CMD:mysignature(playerid, params[])
{
    new string[678];
    format(file, sizeof(file), "RSignature/Users/%s.ini", pname(playerid));
    SignInfo[playerid][Signature] = dini_Int(file, "Signature"); //the problem is here, dini_Int doesn't support dini_Set what should i do now? if i do dini_IntSet the word i wrote in /createsignature will be a value
    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;
}
Reply
#6

pawn Код:
CMD:mysignature(playerid, params[])
{
    new string[678];
    format(file, sizeof(file), "RSignature/Users/%s.ini", pname(playerid));
    format(SignInfo[playerid][Signature], 30, "%s", dini_Get(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;
}
Reply
#7

ok thanks one more last question how to add new line to /mysignature when the length has reach 15 or something, i don't know what is the good value length to create new line you will recieve rep+ you are the only one who help me here
Reply
#8

pawn Код:
strins(SignInfo[playerid][Signature], "\n", 15); // there will be created a new line on position 15
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)