04.02.2015, 12:33
Hi, I got two errors in scripted a dialog.
This dialog is "input", And the typed word in the input dialog will be the "passwordET", passwordET is a password for a gate.
The problem is in (new password[50] = ...) and that (passwordET = password) , Please someone help.
MY QUESTION: HOW TO REPLACE A STRING WITH ANOTHER STRING ?
This dialog is "input", And the typed word in the input dialog will be the "passwordET", passwordET is a password for a gate.
The problem is in (new password[50] = ...) and that (passwordET = password) , Please someone help.
MY QUESTION: HOW TO REPLACE A STRING WITH ANOTHER STRING ?
HTML Code:
C:\Program Files\lvcnrr\gamemodes\SFCNR1.pwn(13257) : error 008: must be a constant expression; assumed zero C:\Program Files\lvcnrr\gamemodes\SFCNR1.pwn(13267) : error 047: array sizes do not match, or destination array is too small Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
PHP Code:
if(dialogid == DIALOG_ETPW)
{
new string[128];
if(response == 1)
{
new password[50] =strval(inputtext); // This is well, But go down to "passwordET = password" and see..
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,DIALOG_ETPW,DIALOG_STYLE_INPUT,"{FFFFFF}ET Gate Password","{FFFFFF}Please enter a new password.","Ok","Cancel");
return 1;
}
format(string,sizeof(string),""COL_ADMIN"[ADMIN] {FFFFFF}You have changed {AFAFAF}[ET]{FFFFFF} gate password to %s!",password);
SCM(playerid,COLOR_WHITE,string);
format(string,sizeof(string),"%s(%d) has changed [ET] gate password.",PlayerName(playerid),playerid);
SendALogMessage(string);
passwordET = password; // HERE IS THE PROBLEM, I want to set a string to string.
return 1;
}
}