must be a constant expression; assumed zero
#1

error 008: must be a constant expression; assumed zero
error line
pawn Код:
new mail[200] = inputtext;
pawn Код:
case demail:
    {
        if(!response) return Kick(playerid);
        if(response)
        {
            if(strfind(inputtext,"@",true) != -1 && strfind(inputtext,".com",true) != -1)
            {
                new mail[200] = inputtext;
it's under ondialogresponse
Reply
#2

replace that line:
format(mail,sizeof(mail),"%s",inputtext);
Reply
#3

Quote:

if(strfind(inputtext,"@",true) != -1)
{
if(strfind(inputtext,".",true) != -1)
{
new string3[64];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "%s.ini", playername3);
strmid(PlayerInfo[playerid][pEmail], inputtext, 0, 32, 32);
dini_Set(string3,"Email",PlayerInfo[playerid][pEmail]);
SaveMail(playerid, inputtext);
return 1;
}

By the way, Change .com to . because there are many types of hotmail, I'm sure I did respond to the same question yesterday
Reply
#4

pawn Код:
INI_WriteString(file"email",mail); // error line
pawn Код:
(8036) : error 001: expected token: ",", but found "-string-"
(8036) : warning 215: expression has no effect
(8036) : warning 215: expression has no effect
(8036) : error 001: expected token: ";", but found ")"
(8036) : error 029: invalid expression, assumed zero
(8036) : fatal error 107: too many error messages on one line
.com at end all mails have .com
Reply
#5

Quote:
Originally Posted by AroseKhanNaizi
Посмотреть сообщение
pawn Код:
INI_WriteString(file"email",mail); // error line
pawn Код:
(8036) : error 001: expected token: ",", but found "-string-"
(8036) : warning 215: expression has no effect
(8036) : warning 215: expression has no effect
(8036) : error 001: expected token: ";", but found ")"
(8036) : error 029: invalid expression, assumed zero
(8036) : fatal error 107: too many error messages on one line
Use what I've told you to use above.
I already answered the same question to you yesterday.
P.S : I've .fr in my mail.
Reply
#6

pawn Код:
if(strfind(inputtext,".",true) != -1)
                {
                new string3[64];
                new playername3[MAX_PLAYER_NAME];
                GetPlayerName(playerid, playername3, sizeof(playername3));
                strmid(pInfo[playerid][email], inputtext, 0, 32, 32);
                new INI:file = INI_Open(Path(playerid)); // we will open a new file for them to save their account inside of Scriptfiles/Users folder
                INI_SetTag(file,"Players_Data");
                INI_WriteString(file,"Name",playername3);//We will set a tag inside of user's account called "Players_Data"
                INI_WriteString(file,"Password",pInfo[playerid][Pass]);
                INI_WriteString(file,"email",pInfo[playerid][email], inputtext);
this is code but same errors
Reply
#7

It's not the code I gave you above, This is dialog of E-Mail, I don't see why you have all of that there :O
Reply
#8

pawn Код:
case demail:
    {
        if(!response) return Kick(playerid);
        if(response)
        {
            if(strfind(inputtext,"@",true) != -1)
            {
                if(strfind(inputtext,".",true) != -1)
                {
                new string[200];
                new playername3[MAX_PLAYER_NAME];
                GetPlayerName(playerid, playername3, sizeof(playername3));
                format(string,sizeof(string),"%s"inputtext);
                pInfo[playerid][mail] =inputtext[200];
                new INI:file = INI_Open(Path(playerid));
                INI_SetTag(file,"Players_Data");
                INI_WriteString(file,"Name",playername3);
                INI_WriteString(file,"Password",pInfo[playerid][Pass]);
                INI_WriteString(file,"email",inputtext[200]);//error line
                INI_WriteInt(file,"AdminLevel",0);
                INI_WriteInt(file,"Donator",0);
                INI_WriteInt(file,"Money",0);
                INI_WriteInt(file,"Scores",0);
                INI_WriteInt(file,"Kills",0);
                INI_WriteInt(file,"Deaths",0);
                INI_WriteInt(file,"Banned",0);
                INI_WriteInt(file,"Savedskin",0);
                INI_WriteInt(file,"Last",0);
                INI_WriteInt(file,"NoPM",0);
                INI_WriteInt(file,"Drugs",150);
                INI_WriteInt(file,"belt",0);
                INI_WriteInt(file,"Jailed",0);
                INI_WriteInt(file,"ad",1);
                INI_WriteInt(file,"raped",0);
                INI_WriteInt(file,"gotraped",0);
                INI_WriteInt(file,"rape_kills",0);
                INI_WriteInt(file,"rape_deaths",0);
                INI_WriteInt(file,"flash",0);
                INI_WriteInt(file,"flash_kills",0);
                INI_WriteInt(file,"flash_deaths",0);
                INI_WriteInt(file,"foff_kills",0);
                INI_WriteInt(file,"foff_deaths",0);
                INI_WriteInt(file,"Weapons_kit",0);
                INI_WriteInt(file,"fighting_style",0);
                INI_WriteInt(file,"MoneyBag_Founded",0);
                INI_WriteInt(file,"DaysAlive",0);
                INI_WriteInt(file,"birthdays",0);
                INI_WriteInt(file,"LottoWins",0);
                INI_WriteInt(file,"pGender",0);
                INI_WriteInt(file,"Bonus_KILLS",0);
                INI_WriteInt(file,"BlockedGoto",0);
                INI_WriteInt(file,"daystimer",1440);
                INI_WriteInt(file,"BankMoney",0);
                INI_WriteInt(file,"Tele_msg",0);
                INI_WriteInt(file,"Death_message",0);
                INI_WriteString(file,"Attacked","none");
                INI_WriteInt(file,"dj",0);
                INI_Close(file);//Now after we've done saving their data, we now need to close the file
                SCM(playerid, COLOR_WHITE, "You have successfully registered On {00B9FF} The - 1vs1 Server{FFFFFF}. Type {FFBE00}/help {FFFFFF}For Game Info.");
                Choose_weapons_first_time[playerid] =1;
                SCM(playerid,0xFFFFFFFF, "Logged in as a {00FFFF}Registered Player.");
                playerloggedin[playerid] =1;
            }
            else
            {
                SCM(playerid,COLOR_RED,"Please Enter An Valid Email.");
                return ShowPlayerDialog(playerid,demail,DIALOG_STYLE_INPUT,"{02FBD6}Register","{FFFFFF}This account is not {02FBD6}registered{FFFFFF} - Please choose enter your{02FBD6} email{FFFFFF}.\nAn Mail will be sent to your account contaning your password.\nIf you already have an {E30544}account{FFFFFF}, then quit and change your nick\nin {E30544}SA-MP {FFFFFF}browser. ","Mail","Quit");
            }
        }
    }
i tried changing it too
pawn Код:
INI_WriteString(file,"email",inputtext);
or
pawn Код:
INI_WriteString(file,"email",string);
or
pawn Код:
INI_WriteString(file,"email",pInfo[playerid][emai]);
pawn Код:
8036) : error 001: expected token: ",", but found "-string-"
(8036) : warning 215: expression has no effect
(8036) : warning 215: expression has no effect
(8036) : error 001: expected token: ";", but found ")"
(8036) : error 029: invalid expression, assumed zero
(8036) : fatal error 107: too many error messages on one line
Reply
#9

pawn Код:
pInfo[playerid][mail] =inputtext[200];
That's not we copy a string to another. Read this: https://sampforum.blast.hk/showthread.php?tid=309130
Reply
#10

yea but i tried the other way too you can see it the string one still no use
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)