03.09.2013, 12:53
If I put the code like this.
I get this error
But if I put the code like this.
I get this error..
How do I fix it?
pawn Код:
if(dialogid == 1)
{
if(response)
{
new namestring[50];
namestring = strval(inputtext); // Error Line
format(string, sizeof(string), "LARP/Users/%s.ini", namestring);
if(!dini_Exists(string))
{
SetPlayerName(playerid, namestring);
format(string, sizeof(string),"You choosed %s as your undercover name. (( To get your normal name back simply type /offduty ))",namestring);
SendClientMessage(playerid,COLOR_RLRPGBLUE,string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You can't take a name that is allready in use.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_RLRPGBLUE, "It would be safer with an undercover name. But ok, you decide.");
return 1;
}
}
Код:
error 033: array must be indexed (variable "namestring")
pawn Код:
if(dialogid == 1)
{
if(response)
{
new namestring[50] = strval(inputtext);//Error Line
format(string, sizeof(string), "LARP/Users/%s.ini", namestring);
if(!dini_Exists(string))
{
SetPlayerName(playerid, namestring);
format(string, sizeof(string),"You choosed %s as your undercover name. (( To get your normal name back simply type /offduty ))",namestring);
SendClientMessage(playerid,COLOR_RLRPGBLUE,string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You can't take a name that is allready in use.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_RLRPGBLUE, "It would be safer with an undercover name. But ok, you decide.");
return 1;
}
}
Код:
must be a constant expression; assumed zero