10.05.2013, 23:38
Hello guys i started on doing a register + login system but i want this tut system so when you register it will force you to go with the tut any ideas?
here is the code anyways.
Thanks for helping & commenting.
here is the code anyways.
Thanks for helping & commenting.
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch( dialogid ) { case DIALOG_REGISTER: { if (!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit"); 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,"Kills",0); INI_WriteInt(File,"Deaths",0); INI_Close(File); SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0); SpawnPlayer(playerid); // i put this here to see if it would work but it didnt this might give you the hint on what am trying to do ShowPlayerDialog(playerid, 151, DIALOG_STYLE_MSGBOX, "{F81414}Meta-Game Part 1", "{F81414}Meta-Game {FFFFFF}is the expression, used to define the act of mixe. If you mixe OOC informations, in IC propose, you are {F81414}Meta-Gaming.", "Next", "Quit"); } } 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); GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]); //ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok",""); } else { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit"); SpawnPlayer(playerid); } return 1; } } } switch(dialogid) { case 150: { if(response) { ShowPlayerDialog(playerid, 151, DIALOG_STYLE_MSGBOX, "{F81414}Meta-Game Part 1", "{F81414}Meta-Game {FFFFFF}is the expression, used to define the act of mixe. If you mixe OOC informations, in IC propose, you are {F81414}Meta-Gaming.", "Next", "Quit"); return 1; } } case 151: { if(response) { ShowPlayerDialog(playerid, 152, DIALOG_STYLE_MSGBOX, "{F81414}Meta-Game Part 2", "{FFFFFF}An example of {F81414}Meta-Gaming, {FFFFFF}is calling someone by the name you see under his head, in the first meet. The name you see up to players head, is an OOC information. ", "Next", "Quit"); return 1; } } case 152: { if(response) { ShowPlayerDialog(playerid, 153, DIALOG_STYLE_MSGBOX, "{F81414}Meta-Game Part 3", "{FFFFFF}Using /pm system to tell someone, to help you, or to meet you somewhere, is also {F81414}Meta-Gaming, {FFFFFF}as you are using an OOC function, the /Pm, to IC proposes.", "Next", "Quit"); return 1; } } case 153: { if(response) { ShowPlayerDialog(playerid, 154, DIALOG_STYLE_MSGBOX, "{F81414}Power-Game Part 1", "{F81414}Power-Game {FFFFFF}is forcing someone to Role-Play your way, or doing something you can't do in Real Life. Some Examples will be given.", "Next", "Quit"); return 1; } } case 154: { if(response) { ShowPlayerDialog(playerid, 155, DIALOG_STYLE_MSGBOX, "{F81414}Power-Game Part 2", "{FFFFFF}If you do any action, that mess with someone, such as puching him, robbing, car-jacking, without giving him a chance to defend, is {F81414}Power-Game.", "Next", "Quit"); return 1; } } case 155: { if(response) { ShowPlayerDialog(playerid, 156, DIALOG_STYLE_MSGBOX, "{F81414}Power-Game Part 3", "{FFFFFF}To give him a chance, you should use the command /do. We will explain you how to use it later. Having a car crash, and keep driving, is alsp {F81414}Power-Game.", "Next", "Quit"); return 1; } } case 156: { if(response) { ShowPlayerDialog(playerid, 157, DIALOG_STYLE_MSGBOX, "{F81414}Death-Match Part 1", "{F81414}Death-Match {FFFFFF}is probably the most easier to explain. It's no more than shooting someone without a good IC reason.", "Next", "Quit"); return 1; } } case 157: { if(response) { ShowPlayerDialog(playerid, 158, DIALOG_STYLE_MSGBOX, "{F81414}In-Charather(IC)", "{F81414}In Charather{FFFFFF}, also known as {F81414}IC, {FFFFFF}is the word used to clasify your in game charather.", "Next", "Quit"); return 1; } } case 158: { if(response) { ShowPlayerDialog(playerid, 159, DIALOG_STYLE_MSGBOX, "{F81414}Out-Of-Charather(OOC)", "{F81414}Out-Of-Charather{FFFFFF}, also known as {F81414}IC{FFFFFF}, is the word used to clasify yourself as a Real Life person.", "Next", "Quit"); return 1; } } case 159: { if(response) { ShowPlayerDialog(playerid, 160, DIALOG_STYLE_MSGBOX, "{F81414}The /me and /do Commands. Part 1", "{F81414}/me {FFFFFF}and {F81414}/do {FFFFFF}are basic and hight needed commands in Role-Play. We will show you some examples.", "Next", "Quit"); return 1; } } case 160: { if(response) { ShowPlayerDialog(playerid, 161, DIALOG_STYLE_MSGBOX, "{F81414}The /me and /do Commands. Part 2", "{FFFFFF}To simply car-jack someone, you need good RolePlay Skills. You have to attemp oppening the door, like that: /me attemps to open car door.", "Next", "Quit"); return 1; } } case 161: { if(response) { ShowPlayerDialog(playerid, 162, DIALOG_STYLE_MSGBOX, "{F81414}The /me and /do Commands. Part 3", "{FFFFFF}After that, you have to use the /do command, to give him a chance to answer. Door might be locked or he can escape before you open it.", "Next", "Quit"); return 1; } } case 162: { if(response) { ShowPlayerDialog(playerid, 163, DIALOG_STYLE_MSGBOX, "{F81414}The /me and /do Commands. Part 4", "{FFFFFF}/do Sucefull/Fail. You can also use /do S/F/. Now, you have to wait player answer. He can answer many different things.", "Next", "Quit"); return 1; } } case 163: { if(response) { ShowPlayerDialog(playerid, 164, DIALOG_STYLE_MSGBOX, "{F81414}The /me and /do Commands. Part 5", "{FFFFFF}He can say /do S. that means the door is now open. He can also /do F, Door Locked. so door is locked and you can't open.", "Next", "Quit"); return 1; } } case 164: { if(response) { ShowPlayerDialog(playerid, 165, DIALOG_STYLE_MSGBOX, "{F81414}The /me and /do Commands. Part 6", "{FFFFFF}Of-course, now you can /me attemps to pull over DriverName. but you also need /do S/F. That if his answer is /do S.", "Next", "Quit"); return 1; } } case 165: { if(response) { ShowPlayerDialog(playerid, 166, DIALOG_STYLE_MSGBOX, "{F81414}The /me and /do Commands. Part 7", "{FFFFFF}If the answer is /do F, door locked. than you can give up, or /me brake the windows with left arm. /me attemps to open the door lock. /do S/F.", "Next", ""); return 1; } } case 166: { if(response) { ShowPlayerDialog(playerid, 167, DIALOG_STYLE_MSGBOX, "{F81414}The /me and /do Commands. Part 8", "{FFFFFF}Well, the winndows braking doesn't depend on other player, so you don't need to attemp it. But, on removing lock, he can block your hand. So, he will probably /do F, i block you.", "Next", ""); return 1; } } case 167: { if(response) { ShowPlayerDialog(playerid, 168, DIALOG_STYLE_MSGBOX, "{F81414}The /me and /do Commands. Part 9", "{FFFFFF}Well, being hard right? You really have to go in the bad way. /me attemps to punsh Driver in nose, and unlock the car. /do S/.", "Next", ""); return 1; } } case 168: { if(response) { ShowPlayerDialog(playerid, 169, DIALOG_STYLE_MSGBOX, "{F81414}The /me and /do Commands. Part 9", "{FFFFFF}Good, let's make it easy now... The driver should /do S. so now, you can take him over the car, and rob it.", "Next", ""); return 1; } } case 169: { if(response) { ShowPlayerDialog(playerid, 170, DIALOG_STYLE_MSGBOX, "{F81414}End of Tutorial", "{FFFFFF}You just ended the tutorial. Hope you've learn. If you will not have all the work of use all these commands on RP, Log out.", "Next", ""); return 1; } } case 170: { if(response) { PlayerInfo[playerid][TutKick] = 0; SendClientMessage(playerid, 0xFFFFFFFF, "Pay attention to your Role-Play, or you will be forced to read it again."); SpawnPlayer(playerid); return 1; } } } return 1; }