Big Help
#1

I made ​​a profile on server and in scriptfiles have profile name.ini but has 0kb and it has nothing is clear and when back on the server again i need make profile.

OnDialog:
Код:
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.");
			}
        }
        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;
}
OnPlayerDisconnect:
Код:
public OnPlayerDisconnect(playerid, reason)
{
	/* Reason of quiting */
    new name[MAX_PLAYER_NAME];

    GetPlayerName(playerid, name, MAX_PLAYER_NAME);


	/* Reason of quiting END */
	{
    new	Mes[1024];
   	format(Mes,sizeof(Mes),""COL_GREY"SERVER: %s je napustio server.",
	GetName(playerid));
	SendClientMessageToAll(0xFFFFFFAA,Mes);
	Log("SERVER/Logs/Left.txt", Mes);
	}
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",GetPlayerCash(playerid));
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"VIP",PlayerInfo[playerid][pVIP]);
    INI_WriteInt(File,"Age",PlayerInfo[playerid][pAge]);
    INI_WriteInt(File,"Sex", PlayerInfo[playerid][pSex]);
    INI_WriteInt(File,"Skin", PlayerInfo[playerid][pSkin]);
    INI_WriteInt(File,"Location", PlayerInfo[playerid][pLocation]);
    INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_WriteInt(File, "Muted", PlayerInfo[playerid][pMuted]);
    INI_WriteInt(File, "MuteTime", PlayerInfo[playerid][pMuteTime]);
   	INI_WriteInt(File, "Locked",PlayerInfo[playerid][pLocked]);
    INI_Close(File);
	{
	AdminDuty[playerid] = 0;
	}
    return 1;
}
OnPlayerConnect:
Код:
public OnPlayerConnect(playerid)
{
    SetPlayerCameraPos(playerid, 1061.1375, -1348.5317, 72.5953);
    SetPlayerCameraLookAt(playerid, 1062.0928, -1348.8217, 72.5754);

	new name[MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, name, sizeof(name));



    if(IsPlayerNPC(playerid)) return 1;

    if(fexist(UserPath(playerid)))
    {
    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_CYAN"LOGIN",""COL_WHITE"Dobrodosli na "COL_CYAN"Gilmore RPG"COL_WHITE"\n"COL_CYAN"%s "COL_WHITE"Vas profil je registriran.\nUnesite vasu lozinku da se logirate","Login","Napusti", name);
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,""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 6/Max 26 znakova\n\n","Register","Napusti",name);
    }
    {
   	GameTextForPlayer(playerid,"~b~G~w~ilmore ~b~R~w~PG ~b~S~w~erver",3000,4);
  	SendClientMessage(playerid,-1,""#W"-------------------------------------------------------------------------------------");
   	SendClientMessage(playerid,-1,""#S"• "#W"Dobro dosli na  "#S"G"#W"ilmore "#S"R"#W"PG "#S"S"#W"erver");
	SendClientMessage(playerid,-1,""#W"-------------------------------------------------------------------------------------");
	}
	//Systems
	{
	ResetPlayerCash(playerid);
    PlayerInfo[playerid][pAdmin] = 0;
    PlayerInfo[playerid][pVIP] = 0;
    AdminDuty[playerid] = 0;
    SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
    SetOriginalColor(playerid);
	}
    {
    new	Mes[1024];
   	format(Mes,sizeof(Mes),""COL_GREY"SERVER: %s se spojio na server.",
	GetName(playerid));
	SendClientMessageToAll(0xFFFFFFAA,Mes);
	Log("SERVER/Logs/Join.txt", Mes);
	}
//REMOVING BULDINGS
//burgpark
RemoveBuildingForPlayer(playerid, 3685, 1249.5547, -905.4609, 45.0313, 0.25);
RemoveBuildingForPlayer(playerid, 3685, 1287.6875, -900.4609, 45.0625, 0.25);
RemoveBuildingForPlayer(playerid, 3685, 1284.2031, -871.2969, 45.2734, 0.25);
RemoveBuildingForPlayer(playerid, 3685, 1245.4609, -874.7031, 45.0703, 0.25);
RemoveBuildingForPlayer(playerid, 617, 1235.8281, -917.5234, 41.8750, 0.25);
RemoveBuildingForPlayer(playerid, 617, 1231.4141, -886.9297, 41.8750, 0.25);
RemoveBuildingForPlayer(playerid, 1232, 1241.1953, -886.8438, 44.3594, 0.25);
RemoveBuildingForPlayer(playerid, 617, 1227.6094, -870.8047, 41.8750, 0.25);
RemoveBuildingForPlayer(playerid, 617, 1261.9531, -913.7813, 41.8750, 0.25);
RemoveBuildingForPlayer(playerid, 1232, 1266.4219, -913.1797, 44.3594, 0.25);
RemoveBuildingForPlayer(playerid, 1308, 1280.2422, -912.5234, 41.3047, 0.25);
RemoveBuildingForPlayer(playerid, 1232, 1272.3516, -912.4531, 44.3594, 0.25);
RemoveBuildingForPlayer(playerid, 617, 1275.6016, -911.9609, 41.8750, 0.25);
RemoveBuildingForPlayer(playerid, 3684, 1249.5547, -905.4609, 45.0313, 0.25);
RemoveBuildingForPlayer(playerid, 617, 1263.8828, -894.3516, 41.8750, 0.25);
RemoveBuildingForPlayer(playerid, 1211, 1266.0859, -906.7031, 42.3984, 0.25);
RemoveBuildingForPlayer(playerid, 1232, 1270.9609, -896.6172, 44.3594, 0.25);
RemoveBuildingForPlayer(playerid, 1232, 1265.0313, -897.3516, 44.3594, 0.25);
RemoveBuildingForPlayer(playerid, 617, 1271.8672, -892.3672, 41.8750, 0.25);
RemoveBuildingForPlayer(playerid, 617, 1299.5000, -909.1406, 41.8750, 0.25);
RemoveBuildingForPlayer(playerid, 3684, 1287.6875, -900.4609, 45.0625, 0.25);
RemoveBuildingForPlayer(playerid, 5847, 1295.8594, -895.0938, 41.7109, 0.25);
RemoveBuildingForPlayer(playerid, 1232, 1252.2578, -885.8750, 44.3594, 0.25);
RemoveBuildingForPlayer(playerid, 617, 1262.9844, -882.2188, 41.8750, 0.25);
RemoveBuildingForPlayer(playerid, 617, 1271.2031, -882.3984, 41.8750, 0.25);
RemoveBuildingForPlayer(playerid, 1232, 1285.6484, -881.3125, 44.3594, 0.25);
RemoveBuildingForPlayer(playerid, 3684, 1245.4609, -874.7031, 45.0703, 0.25);
RemoveBuildingForPlayer(playerid, 3684, 1284.2031, -871.2969, 45.2734, 0.25);
RemoveBuildingForPlayer(playerid, 1232, 1303.1094, -879.9531, 44.3594, 0.25);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)