18.10.2016, 16:48
hello guys, I am making a tutorial system for my server, and this is my ondialogresponse code:
and here below is the tutorial code
how do I make my character spawn right after the tutorial is finished and give him some cash (AND save it)? spawnplayer doesn't work for me..and when i use GivePlayerMoney is just doesn't save it when I login next time.
How to fix that? p.s. for death too
thanks in advance to anyone who can help
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch(dialogid) { case DIALOG_REGISTER: { if(!response) Kick(playerid); else { if(!strlen(inputtext)) { SendClientMessage(playerid, COLOR_SYS, "* [SERVER]: {FFFFFF}You have to enter your desired password in order to register."); return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "{00F1F1}Welcome To Anynoymous Creek Roleplay!", "{FFFFFF}I see it's your first time here! Let me introduce myself, my name is {00F1F1}Cesar!\n{FF4747}*You are going to play on a server, where the roleplay begins from the registration!*\n\n{E6C700}Please enter your desired password below:", "Begin", "Quit"); } WP_Hash(PlayerInfo[playerid][Password], 129, inputtext); new INI:file = INI_Open(UserPath(playerid)); INI_SetTag(file, "PlayerInfo"); INI_WriteString(file, "Password", PlayerInfo[playerid][Password]); INI_WriteInt(file, "AdminLevel", 0); INI_WriteInt(file, "VIPLevel", 0); INI_WriteInt(file, "Money", 0); INI_WriteInt(file, "Score", 0); INI_WriteInt(file, "Kills", 0); INI_WriteInt(file, "Deaths", 0); INI_WriteInt(file, "Faction", 0); INI_WriteInt(file, "Facrank", 0); INI_WriteInt(file, "Facleader", 0); INI_Close(file); SendClientMessage(playerid, COLOR_SYS, "* [SERVER]: {FFFFFF}You have successfully created an account at {00F1F1}Palomino Creek Roleplay!"); SendClientMessage(playerid, COLOR_SYS, "* [SERVER]: {FFFFFF}For more help you can use {00F1F1}/cmds, /help, /map."); SendClientMessage(playerid, COLOR_GOLD, " *[TIP] - If spotted a hacker, or found a bug use /report to request admin assistance."); PlayerInfo[playerid][LoggedIn] = true; TogglePlayerSpectating(playerid, true); SendClientMessage(playerid, -1, ""); SendClientMessage(playerid, -1, ""); SendClientMessage(playerid, -1, ""); SendClientMessage(playerid,COLOR_LIGHTBLUE,"Before we will start playing I want you to go through a quick tutorial."); TextDrawHideForPlayer(playerid, Text:Textdraw7); TextDrawHideForPlayer(playerid, Text:Textdraw8); TextDrawHideForPlayer(playerid, Text:Textdraw9); TextDrawHideForPlayer(playerid, Text:Textdraw10); TextDrawHideForPlayer(playerid, Text:Textdraw11); TextDrawHideForPlayer(playerid, Text:Textdraw12); TextDrawHideForPlayer(playerid, Text:Textdraw13); TextDrawHideForPlayer(playerid, Text:Textdraw14); TextDrawHideForPlayer(playerid, Text:Textdraw15); TextDrawHideForPlayer(playerid, Text:Textdraw16); TextDrawHideForPlayer(playerid, Text:Textdraw17); TextDrawHideForPlayer(playerid, Text:Textdraw18); TextDrawHideForPlayer(playerid, Text:Textdraw19); TextDrawHideForPlayer(playerid, Text:Textdraw20); TextDrawHideForPlayer(playerid, Text:Textdraw21); SetTimerEx("OnPlayerInTutorial",6000,0,"ii",playerid,1); return 1; } }
Код:
forward OnPlayerInTutorial(playerid,step); public OnPlayerInTutorial(playerid,step) { switch(step) { case 1: { //2nd message SendClientMessage(playerid,-1,"here the text"); SetTimerEx("OnPlayerInTutorial",5000,0,"ii",playerid,2); return 1; } case 2: { //3rd message SendClientMessage(playerid,-1,"here the text"); SetTimerEx("OnPlayerInTutorial",5000,0,"ii",playerid,3); return 1; } case 3: { SendClientMessage(playerid,-1,"You're tutorial is finish."); SpawnPlayer(playerid); return 1; } } return 1; }
How to fix that? p.s. for death too
thanks in advance to anyone who can help