Jump to content
  • 0

Nu imi apare un dialog


ScaRLighT

Question

Problema intalnita (descriere): Dupa ce ma inregistrez ar trebuie sa-mi mai apara dialogul in care iti alegi sexul, dar nu apare si imi muta camera (vezi imaginea).
Ero(area / rile) / warning-(ul / urile): Nu am
Liniile de cod / sursa / script-ul(obligatoriu):

function OnPlayerRegister(playerid)
{
    new string[128], hours, minutes, year, month, day, loginstring[128];
	PlayerData[playerid][ID] = cache_insert_id();
	
	gettime(hours, minutes);
	getdate(year, month, day);
	
	format(string, sizeof(string), "%02d.%02d.%02d %02d:%02d",day,month,year,hours,minutes);
	strmid(PlayerData[playerid][RegDate], string, 0, strlen(string), 255);

	mysql_format(SQL, string,128,"UPDATE `users` SET `RegisterDate`='%s' WHERE `Name`='%s' LIMIT 1",PlayerData[playerid][RegDate],PlayerData[playerid][Name]);
	mysql_tquery(SQL, string, "", "");
	
 //despre acest dialog este vorba
	ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_LIST, "Please choose your gender", "Male\nFemale", "Select", "Cancel");
	
	ServerInfo[users]++;
	strmid(ServerInfo[newestacc], PlayerData[playerid][Name], 0, strlen(PlayerData[playerid][Name]), 255);

	mysql_format(SQL, loginstring,128,"UPDATE `infos` SET `users`='%d' WHERE ID = 1",ServerInfo[users]);
	mysql_tquery(SQL, loginstring, "", "");
	mysql_format(SQL, loginstring,128,"UPDATE `infos` SET `newestacc`='%s' WHERE ID = 1",ServerInfo[newestacc]);
	mysql_tquery(SQL, loginstring, "", "");
	
	return 1;
}

Iar acesta este codul dialogului:

case DIALOG_GENDER:
		{
		    if(response)
			{
			    if(listitem == 0)
				{
				    PlayerData[playerid][Character] = 250;
					PlayerData[playerid][Gender] = 1;
                    Update(playerid, CharacterUpdate);
					Update(playerid, GenderUpdate);

			//Apoi ar trebui sa treaca la acesta.			
                    format(string, sizeof(string), "Account registered, you can login now by typing your password below.");
	                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", string, "Login", "Abort");
					return 0;
			    }
				if(listitem == 1)
				{
				    PlayerData[playerid][Character] = 56;
					PlayerData[playerid][Gender] = 2;
                    Update(playerid, CharacterUpdate);
					Update(playerid, GenderUpdate);

					format(string, sizeof(string), "Account registered, you can login now by typing your password below.");
	                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", string, "Login", "Abort");
					return 0;
				}
			}
			else Kick(playerid);
		}


Imagini / Video (optional): http://imgur.com/m4obQUQ
Ati incercat sa rezolvati singur?: Da, am incercat.

Edited by ScaRLighT
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
	    case DIALOG_REGISTER:
	    {
	        if(!response)
	            return Kick(playerid);

			if((strlen(inputtext) > 0) && (strlen(inputtext) < 25))
		    {
			    new ip[25];
			    GetPlayerIp(playerid, ip, sizeof(ip));
				WP_Hash(PlayerData[playerid][Password], 129, inputtext);

				mysql_format(SQL, query, sizeof(query), "INSERT INTO `users` (`Name`, `Password`, `IP`) VALUES ('%e', '%s', '%e')", PlayerData[playerid][Name], PlayerData[playerid][Password],ip);
				mysql_tquery(SQL, query, "OnPlayerRegister", "d", playerid);
			}
			else
			{
				SendClientMessage(playerid, COLOR_WHITE, "{FF0000}AdmBot{FFFFFF}: You've enter a very long password, nice try. Your IP was saved in our log.");
			/*	format(string, sizeof(string), "%s enters a very long password in login dialog",PlayerData[playerid][Name]);
				FloodLog(string,playersip); */
				format(string, 256, "Warning: %s(%d) enters a very long password in login dialog | IP: %s", PlayerData[playerid][Name],playerid,playersip);
				ABroadCast(RED,string,1);
				KickEx(playerid);
			}
	    }

EDIT: Am rezolvat problema. Era din cauza unor tabele din MySQL care nu aveau default value. Erorile mi-au aparut ulterior.

Edited by ScaRLighT
Problem solved!
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.