SA-MP Forums Archive
How to save it correctly...(y_ini) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to save it correctly...(y_ini) (/showthread.php?tid=570327)



How to save it correctly...(y_ini) - Scrillex - 08.04.2015

Hello dear samp forum users.. I need some help with saving phone number in y_ini file...

ERROR:
pawn Код:
(399) : error 006: must be assigned to an array
(399) : error 029: invalid expression, assumed zero
(399) : warning 215: expression has no effect
pawn Код:
pInfo[playerid][PhoneNumber] = "310%d%d%d%d%d%d%d", random( 10 ), random( 10 ), random( 10 ), random( 10 ), random( 10 ), random( 10 ), random( 10 ) );
With best regards Scrillex.


AW: How to save it correctly...(y_ini) - Mencent - 08.04.2015

Hello!

Write it in the following way:
PHP код:
new string[128];
format(string,sizeof string,"310%d%d%d%d%d%d%d",random(10),random(10),random(10),random(10),random(10),random(10),random(10));
pInfo[playerid][PhoneNumber] = strval(string); 
Mencent


Re: How to save it correctly...(y_ini) - Scrillex - 09.04.2015

It will be in correct way?


AW: How to save it correctly...(y_ini) - Mencent - 09.04.2015

Try it, it will be right.

Mencent


Re: How to save it correctly...(y_ini) - Scrillex - 09.04.2015

It ain't saving!

pawn Код:
if(dialogid == dialog_Register)
    {
        if(!response) return Kick(playerid);

        if(response)
        {
            if(!strlen(inputtext)) return ShowPlayerDialog(playerid, dialog_Register, DIALOG_STYLE_INPUT, "Authenticate", "Please enter a password below in order to register.", "Register", "Quit");

            WP_Hash(hashpass, sizeof(hashpass), inputtext);

            pInfo[playerid][Pass] = hashpass;

            pInfo[playerid][HouseOwner] = 999;
            pInfo[playerid][BizOwner] = 999;
            pInfo[playerid][CarOwner] = 999;

            pInfo[playerid][MaskNumber] = random(1000 + 2500);
            new string[128];
            format(string,sizeof string,"310%d%d%d%d%d%d%d",random(10),random(10),random(10),random(10),random(10),random(10),random(10));
            pInfo[playerid][PhoneNumber] = strval(string);
            pInfo[playerid][PIN] = random(1000 + 2500);
            pInfo[playerid][CardNumber] = random(1000 + 2500);
            pInfo[playerid][ExpLeft] = 8;
            pInfo[playerid][Level] = 1;

            format(sHolder, sizeof(sHolder), "None");
            pInfo[playerid][FactionRank] = sHolder;

            SavePlayer(playerid);

            TogglePlayerSpectating(playerid, false);
            SetSpawnInfo(playerid, 0, 299, 1740.6188, -1949.9669, 14.1172, 176.0951, 0, 0, 0, 0, 0, 0);
            SetTimerEx("LevelTimer", 1800000, true, "i", playerid);

            SpawnPlayer(playerid);
            Logged[playerid] = true;

            ShowModelSelectionMenu(playerid, skinlist, "Select Skin");

            return true;
        }
    }



Re: How to save it correctly...(y_ini) - Scrillex - 10.04.2015

Someone?


AW: How to save it correctly...(y_ini) - Mencent - 10.04.2015

What is printing?
PHP код:
if(dialogid == dialog_Register)
    {
        if(!
response) return Kick(playerid);
        if(
response)
        {
            if(!
strlen(inputtext)) return ShowPlayerDialog(playeriddialog_RegisterDIALOG_STYLE_INPUT"Authenticate""Please enter a password below in order to register.""Register""Quit");
            
WP_Hash(hashpasssizeof(hashpass), inputtext);
            
pInfo[playerid][Pass] = hashpass;
            
pInfo[playerid][HouseOwner] = 999;
            
pInfo[playerid][BizOwner] = 999;
            
pInfo[playerid][CarOwner] = 999;
            
pInfo[playerid][MaskNumber] = random(1000 2500);
            new 
string[128];
            
format(string,sizeof string,"310%d%d%d%d%d%d%d",random(9),random(9),random(9),random(9),random(9),random(9),random(9));
            
pInfo[playerid][PhoneNumber] = strval(string);
            print(string);
            
pInfo[playerid][PIN] = random(1000 2500);
            
pInfo[playerid][CardNumber] = random(1000 2500);
            
pInfo[playerid][ExpLeft] = 8;
            
pInfo[playerid][Level] = 1;
            
format(sHoldersizeof(sHolder), "None");
            
pInfo[playerid][FactionRank] = sHolder;
            
SavePlayer(playerid);
            
TogglePlayerSpectating(playeridfalse);
            
SetSpawnInfo(playerid02991740.6188, -1949.966914.1172176.0951000000);
            
SetTimerEx("LevelTimer"1800000true"i"playerid);
            
SpawnPlayer(playerid);
            
Logged[playerid] = true;
            
ShowModelSelectionMenu(playeridskinlist"Select Skin");
            return 
true;
        }
    } 
In addition you have to write it so:
PHP код:
format(string,sizeof string,"310%d%d%d%d%d%d%d",random(9),random(9),random(9),random(9),random(9),random(9),random(9)); 
Mencent


Re: How to save it correctly...(y_ini) - Scrillex - 10.04.2015

printing -random number... it aint sowing it as it's needed.... it shows it in -without 310 in front...


AW: How to save it correctly...(y_ini) - Mencent - 10.04.2015

Ok!
Make in the enum the PhoneNumber to String (max length 11) and then write the code so:
PHP код:
if(dialogid == dialog_Register)
    {
        if(!
response) return Kick(playerid);
        if(
response)
        {
            if(!
strlen(inputtext)) return ShowPlayerDialog(playeriddialog_RegisterDIALOG_STYLE_INPUT"Authenticate""Please enter a password below in order to register.""Register""Quit");
            
WP_Hash(hashpasssizeof(hashpass), inputtext);
            
pInfo[playerid][Pass] = hashpass;
            
pInfo[playerid][HouseOwner] = 999;
            
pInfo[playerid][BizOwner] = 999;
            
pInfo[playerid][CarOwner] = 999;
            
pInfo[playerid][MaskNumber] = random(1000 2500);
            
format(pInfo[playerid][PhoneNumber],11,"310%d%d%d%d%d%d%d",random(9),random(9),random(9),random(9),random(9),random(9),random(9));
            
pInfo[playerid][PIN] = random(1000 2500);
            
pInfo[playerid][CardNumber] = random(1000 2500);
            
pInfo[playerid][ExpLeft] = 8;
            
pInfo[playerid][Level] = 1;
            
format(sHoldersizeof(sHolder), "None");
            
pInfo[playerid][FactionRank] = sHolder;
            
SavePlayer(playerid);
            
TogglePlayerSpectating(playeridfalse);
            
SetSpawnInfo(playerid02991740.6188, -1949.966914.1172176.0951000000);
            
SetTimerEx("LevelTimer"1800000true"i"playerid);
            
SpawnPlayer(playerid);
            
Logged[playerid] = true;
            
ShowModelSelectionMenu(playeridskinlist"Select Skin");
            return 
true;
        }
    } 
Mencent


Re: How to save it correctly...(y_ini) - Scrillex - 10.04.2015

Thanks it worked