PDA

View Full Version : Dialog Help!


OpticKiller
01/06/2013, 02:24 AM
Hi guys how would i get this register system with my tut system so the register system will follow with the tut etc.




if(dialogid == 0) // Tutorial
{
if(response)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}You have chosen to complete registeration, Please wait until the tutorial to load.");
SetTimerEx("Tut1", 2000, false, "i", playerid);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}You have chosen to not to complete registeration.");
Kick(playerid);
}
}
new tmp2[256];
if(IsPlayerConnected(playerid))
{
if(dialogid == 1)
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"REGISTER","Welcome to Infusion Gaming.\n\nPlease register your account by typing the password below.","Register","Quit");
TutTime[playerid] = 1;
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",100);
INI_WriteInt(File,"Skin",0);
INI_WriteInt(File,"Level",0);
INI_WriteInt(File, "Respect", PlayerInfo[playerid][pExp] = 0);
INI_WriteInt(File,"Int",0);
INI_WriteInt(File,"VW",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"SecKey",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteFloat(File,"FacingAngle",0);
INI_WriteFloat(File,"Health",0);
INI_WriteFloat(File,"Armour",0);
INI_WriteFloat(File,"LastX",0);
INI_WriteFloat(File,"LastY",0);
INI_WriteFloat(File,"LastZ",0);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerScore(playerid, 1);
GivePlayerMoney(playerid, 100);
SetCameraBehindPlayer(playerid);
PlayerInfo[playerid][pSkin] = 185;
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][pVW] = 0;
PlayerInfo[playerid][pLevel] = 1;
GameTextForPlayer(playerid, tmp2, 5000, 1);
TogglePlayerSpectating(playerid, 0);
SetSpawnInfo(playerid, 0, 299, 982.1890, -1624.2583, 14.9526, 90, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
INI_Close(File);
}
}
if(dialogid == 2)
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pLastX], PlayerInfo[playerid][pLastY], PlayerInfo[playerid][pLastZ], PlayerInfo[playerid][pFacingAngle], 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
format(tmp2, sizeof(tmp2), "~b~Welcome ~n~~w~%s", GetName(playerid));
GameTextForPlayer(playerid, tmp2, 5000, 1);
TogglePlayerSpectating(playerid, 0);
if(PlayerInfo[playerid][pAdmin] >= 1)
{
SendClientMessage(playerid, COLOR_WHITE,tmp2);
ShowPlayerDialog(playerid, 3,DIALOG_STYLE_INPUT, COL_LIGHTBLUE "ADMIN LOGIN","Please provide your security code for your admin account to be authorized.\n\nPlease enter your security code below.","Login","Quit"); //admin authorization
}
}
else
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD, COL_LIGHTBLUE "LOGIN","Welcome back to Infusion Gaming.\n\nThat name is registered. Please enter your password below.","Login","Quit");
}
return 1;
}
}