Please HELP! rep++
#1

I spent my whole day on trying to figure out whats going on and I am going to flip out I dont get whats wrong can anyone help. So what are the problems. 1st problem is when I connect on server and when I register it all saves fine in users folder I open it and I see its all there how it should be but when I go out of server and back on it shows me a login dialo I type my password it wont let me in i try slowly like 5 times and it says it is wrong password and then I went to my script and I had my old game mode with the same login system and I copy this part

Код:
if(dialogid == DIALOG_LOGIN)
	{
	    if(!response) return Kick(playerid);
		if(response)
		{
			new hashpass[129];
			WP_Hash(hashpass,sizeof(hashpass),inputtext);
			if(!strcmp(hashpass, PlayerInfo[playerid][pPass], false))
			{
                INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);
                TogglePlayerSpectating(playerid, 0);
				GivePlayerMoney(playerid,PlayerInfo[playerid][pNovac]);
			}
			else
			{
				ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_BIJELA"Balkan Godfather-"COL_ZLATNA"Login",""COL_BIJELA"Unijeli ste "COL_CRVENA"pogresnu Lozinku!\n\n"COL_BIJELA"Pokusaj "COL_ZLATNA"Ponovo!","Uredu","Odustani");
			}
		}
		return 1;
	}
and replace it with my problematic part this one
Код:
if(dialogid == DIALOG_LOGIN)
	{
	    if(!response) return Kick(playerid);
		if(response)
		{
			new hashpass[129];
			WP_Hash(hashpass,sizeof(hashpass),inputtext);
			if(!strcmp(hashpass, PlayerInfo[playerid][pPass], false))
			{
                INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);
                TogglePlayerSpectating(playerid, 0);
                CancelSelectTextDraw(playerid);
				GivePlayerMoney(playerid,PlayerInfo[playerid][pNovac]);
			}
			else
			{
				ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_BIJELA"Balkan Godfather-"COL_ZLATNA"Login",""COL_BIJELA"Unijeli ste "COL_CRVENA"pogresnu Lozinku!\n\n"COL_BIJELA"Pokusaj "COL_ZLATNA"Ponovo!","Uredu","Odustani");
			}
		}
		return 1;
	}
As u can see there is no difference between them except my second part have CancelSelectTextDraw(playerid); and thats it. And when I replace them it works fine but then here it goes second problem. It spawns me with no money but it should becouse I typed GivePlayerMoney(playerid, PlayerInfo[playerid][pNovac]); and in my .ini file I can see that it saved 1000$ becouse I saved it when the player register to give him the money and save the file. And 3rd problem is that I just cant figure out what the actual f**k this spawns mean I tried setplayerpos setplayerskin setspawninfo addplayerclass and no one will spawn me with the skin that I saved in PlayerInfo[playerid][pSkin]. It spawns my weapons but it wont spawn me in the skin. You can see ondialogrespons I have if statment on DIALOG_SPOL if(listitem == 0) PlayerInfo[playerid][pSkin] = 59; and I save it and it did save but I cannot spawn as that skin. So if u know how to fix this pls help me cuz I am going to kill my self I scripted 3 days in a row and I did a perfect login/register system and yesterday I scripted dynamic organization and I succeed but the spawn started to bother me and suddenly my login doesnt work. I tried to fix it but I was to tired to even try and I just dont get it.

[EDIT]
Yea and here is the Pastebin: http://pastebin.com/sYQ557hP
Reply
#2

Is PlayerInfo[playerid][pPass] hashed and load correctly?
Reply
#3

To set the skin use SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
Reply
#4

I think it is I had no problems before with it. I can send u the whole script and u test it it like 1k lines.
Код:
if(dialogid == DIALOG_LOZINKA)
	{
		if(response)
		{
		    if(!strlen(inputtext))
			{
			    ShowPlayerDialog(playerid, DIALOG_LOZINKA, DIALOG_STYLE_INPUT, ""COL_BIJELA"Balkan Godfather-"COL_ZLATNA"Lozinka",""COL_BIJELA"Unijeli ste pogresan format "COL_CRVENA"sifre!\n\n"COL_BIJELA"Pokusaj "COL_ZLATNA"Ponovo!\n","Dalje","Odustani");
				return 1;
			}
			else
			{
				new hashpass[129]; 
				WP_Hash(hashpass, 129, inputtext); 

				strdel(PlayerInfo[playerid][pPass], 0, 128); 
				strcat(PlayerInfo[playerid][pPass], inputtext, 129); 

				new INI:file = INI_Open(Path(playerid));
				INI_WriteString(file,"Password",hashpass); 
				INI_Close(file); 
	        }
		}
		return 1;
	}
Reply
#5

Quote:
Originally Posted by Terrorizt
Посмотреть сообщение
To set the skin use SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
But where should I put it under OnPlayerRequestClass OnPlayerRequestSpawn OnPlayerConnect DIALOG_LOGIN or what? and should I use SetPlayerPos or SetSpawnInfo bcus I need to force them to spawn I dont know is it possible to force spawn when I choose setPlayerPos
Reply
#6

Use SetSpawnInfo before TogglePlayerSpectating.

Load player's data, use SetSpawnInfo and make him spawn using TogglePlayerSpectating(playerid, 0);
Reply
#7

I think it is not about the commands its more of an loading problem. The thing is that it is not just about skin wont load but it wont load money whic is saved in my .ini So u see here
Код:
Password = 
Skin = 59
Spol = 1
Godine = 17
Porijeklo = 1
Email = @gmail.com
Smrti = 0
Ubistva = 0
Novac = 1000
Admin = 0
I saved money and skin and all but it wont load when i login onto my account.

[EDIT]

I tried with setspawninfo and TogglePlayerSpectating(playerid, 0); it still doesnt work it doesnt spawn me in the skin id 59* It gave me the guns but it wont load skin and money
Reply
#8

Quote:
Originally Posted by baba1234
Посмотреть сообщение
But where should I put it under OnPlayerRequestClass OnPlayerRequestSpawn OnPlayerConnect DIALOG_LOGIN or what? and should I use SetPlayerPos or SetSpawnInfo bcus I need to force them to spawn I dont know is it possible to force spawn when I choose setPlayerPos
SetPlayerSkin, GivePlayerScore, GivePlayerMoney here to load Skin, score, money etc:
Код:
if(dialogid == DIALOG_LOGIN)
{		
    if(!response) Kick(playerid);        
    if(response)
    {
        new hashpass[129];
	WP_Hash(hashpass,sizeof(hashpass),inputtext);
	if(!strcmp(hashpass, PlayerInfo[playerid][pPass], false))
	{
             INI_ParseFile(Path(playerid),"LoadData_%s",.bExtra = true, .extra = playerid);
             SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
             GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
             SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
	}
    }
}
Also i recommend you to use SetSpawnInfo because player will spawn there everytime he dies. SetPlayerPos is mostly used for TPs.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)