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(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(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(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;
}
}
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(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);
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(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;
}
}
Mencent
Re: How to save it correctly...(y_ini) -
Scrillex - 10.04.2015
Thanks it worked