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; }
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); |
You have more options. You may set the Money from the moment where you create the INI file.
You need to keep in mind that if the player is going to take the tutorial again in some point, his money is going to be SET and not updated. You may also set players money in right after your tutorial, as I read your code. In case X, the last case in general, you may use your function to set players money. You need to search for your give money function in your gamemode and use it in your last case. If your functions doesn't work, you would like to paste the functions here so we can figure it out. |
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);
SA-MP Dedicated Server ---------------------- v0.3.7-R2, ©2005-2015 SA-MP Team [21:07:16] [21:07:16] Server Plugins [21:07:16] -------------- [21:07:16] Loading plugin: streamer [21:07:16] *** Streamer Plugin v2.8.2 by Incognito loaded *** [21:07:16] Loaded. [21:07:16] Loading plugin: sscanf [21:07:16] [21:07:16] =============================== [21:07:16] sscanf plugin loaded. [21:07:16] Version: 2.8.2 [21:07:16] © 2012 Alex "******" Cole [21:07:16] =============================== [21:07:16] Loaded. [21:07:16] Loading plugin: whirlpool [21:07:16] [21:07:16] ================== [21:07:16] [21:07:16] Whirlpool loaded [21:07:16] [21:07:16] ================== [21:07:16] [21:07:16] Loaded. [21:07:16] Loaded 3 plugins. [21:07:16] [21:07:16] Filterscripts [21:07:16] --------------- [21:07:16] Loading filterscript 'gl_realtime.amx'... [21:07:16] Loading filterscript 'skinchanger.amx'... [21:07:16] --Admin Player Skin Changer Loaded [21:07:16] Loading filterscript 'vspawner.amx'... [21:07:16] --Admin Vehicle Spawner Loaded [21:07:16] Loaded 3 filterscripts. [21:07:16] [21:07:16] [21:07:16] [21:07:16] ======================================= [21:07:16] | | [21:07:16] | YSI version 4.00.0001 | [21:07:16] | By Alex "******" Cole | [21:07:16] | | [21:07:16] ======================================= [21:07:16] [21:07:16] *** YSI Warning: y_malloc set up via "CallLocalFunction", memory corruption is a remote possibility [21:07:16] Number of vehicle models: 3