PDA

View Full Version : Server does not save data


TiXz0r
07/12/2013, 03:11 PM
I do all the work profile, go out to the server and back again, and I need to register again, does nothing to scriptfiles

Who has time to look to send him a script on pm :)

btw.

i have
#define PATH "/SERVER/Users/%s.ini"

and have in scriptfiles
\SERVER\Users

Loot
07/12/2013, 04:01 PM
We're not psychics, we need to see the code in order to help you.

TiXz0r
07/12/2013, 04:07 PM
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

switch( dialogid )
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
new name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_CYAN"REGISTER",""COL_WHITE"Dobrodosli na "COL_CYAN"Gilmore RPG"COL_WHITE"\nVase Ime i Prezime "COL_CYAN"%s \n"COL_WHITE"Vas profil "COL_RED"nije "COL_WHITE"registriran\nUnesite zeljenu lozinku da se registrirate\n\nLozinka: "COL_RED"Min 4/Max 14 znakova\n\n","Register","Napusti",name);
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"VIP",0);
INI_WriteInt(File,"Age",0);
INI_WriteInt(File,"Sex",2);
INI_WriteInt(File,"Skin",0);
INI_WriteInt(File,"Location",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File, "Muted",0);
INI_WriteInt(File, "MuteTime",0);
INI_WriteInt(File, "Locked",0);
GivePlayerCash(playerid, 100);
PlayerInfo[playerid][pAdmin] = 0;
PlayerInfo[playerid][pVIP] = 0;
INI_Close(File);

ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT,""COL_CYAN"REGISTER","Koliko imate godina?","Dalje","");
}
}
case DIALOG_AGE:
{
if(!response) return Kick(playerid);
if(response)
{
new age, message[64];

age = strval(inputtext);
if(age < 13 || age > 40)
{
ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT,""COL_CYAN"REGISTER","Koliko imate godina?","Dalje","");
SendClientMessage(playerid, 0xFFFFFFFF, ""COL_RED"GRESKA: "COL_WHITE"Vase godine ne smiju biti manje od 13 i vece od 40.");
}
else
{
PlayerInfo[playerid][pAge] = age;
format(message, sizeof(message), ""COL_CYAN"SERVER: "COL_WHITE"U redu,imas %d godina.", age);
SendClientMessage(playerid, 0xFFFFFFFF, message);
ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_LIST,""COL_CYAN"IZABERITE KOJI STE SPOL?","Muski\nZenski","Dalje","");
}
}
}
case DIALOG_SEX:
{
if(response)
{
new message[64];
if(listitem == 0)
{
PlayerInfo[playerid][pSex] = 0;
format(message, sizeof(message), ""COL_CYAN"SERVER: "COL_WHITE"U redu,musko ste.");
SendClientMessage(playerid, 0xFFFFFFFF, message);
PlayerInfo[playerid][pSkin] = 299;
printf("Skin has been set to 20");
ShowPlayerDialog(playerid, DIALOG_LOCATION, DIALOG_STYLE_LIST,""COL_CYAN"IZABERITE GRAD","Los Santos\nSan Fierro\nLas Venturas","Ok","");
}
if(listitem == 1)
{
PlayerInfo[playerid][pSex] = 1;
format(message, sizeof(message), ""COL_CYAN"SERVER: "COL_WHITE"U redu,zensko ste.");
SendClientMessage(playerid, 0xFFFFFFFF, message);
PlayerInfo[playerid][pSkin] = 12;
printf("Skin has been set to 12");
ShowPlayerDialog(playerid, DIALOG_LOCATION, DIALOG_STYLE_LIST,""COL_CYAN"IZABERITE GRAD","Los Santos\nSan Fierro\nLas Venturas","Ok","");
}
}
}
case DIALOG_LOCATION:
{
if(!response) return Kick(playerid);
if(response)
{
new message[64];
if(listitem == 0)
{
PlayerInfo[playerid][pLocation] = 0;
format(message, sizeof(message), ""COL_CYAN"SERVER: "COL_WHITE"Izabrali ste Los Santos.");
SendClientMessage(playerid, 0xFFFFFFFF, message);
SpawnPlayer(playerid);
}
if(listitem == 1)
{
PlayerInfo[playerid][pLocation] = 1;
format(message, sizeof(message), ""COL_CYAN"SERVER: "COL_WHITE"Izabrali ste San Fierro.");
SendClientMessage(playerid, 0xFFFFFFFF, message);
SpawnPlayer(playerid);
}
if(listitem == 2)
{
PlayerInfo[playerid][pLocation] = 2;
format(message, sizeof(message), ""COL_CYAN"SERVER: "COL_WHITE"Izabrali ste Las Venturas.");
SendClientMessage(playerid, 0xFFFFFFFF, message);
SpawnPlayer(playerid);
}
new DialogString[1024];
format(DialogString, sizeof DialogString, "%s%s%s%s%s%s%s%s", reg1, reg2, reg3, reg4, reg5, reg6, reg7, reg8);
ShowPlayerDialog(playerid,1234, DIALOG_STYLE_MSGBOX,"USPJESNO STE SE REGISTRIRALI", DialogString,"Zatvori","");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, ""COL_CYAN"SERVER: "COL_WHITE"Uspjesno ste se registrirali,sada mozete igrati.");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, ""COL_CYAN"SERVER: "COL_WHITE"Da vidite listu komandi kucajte /commands.");
SendClientMessage(playerid, 0xFFFFFFFF, ""COL_CYAN"SERVER: "COL_WHITE"Ako vam treba pomoc kucajte /help");
SendClientMessage(playerid, 0xFFFFFFFF, ""COL_CYAN"SERVER: "COL_WHITE"Ako ste novi kucajte /new.");
SendClientMessage(playerid, 0xFFFFFFFF, " ");
SendClientMessage(playerid, 0xFFFFFFFF, ""COL_CYAN"SERVER: "COL_WHITE"Nalazite se na SPAWNU,to je glavni park,a desno je BURG gdje je glavno mjesto servera.");
}
return 1;
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 0,0,0,0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
}
else
{
Kick(playerid);
}
return 1;
}
}
}
return 1;
}


here is register system

simo0000
07/12/2013, 04:42 PM
wait i try ;)

TiXz0r
07/12/2013, 08:01 PM
okay :)