Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- // Inludes //
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- #include <a_samp>
- #include <zcmd>
- #include <YSI\y_ini>
- #include <filemanager>
- #include <dialogs>
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- // Colors //
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- #define C_Default 0xD3D3D3FF
- #define C_T_Default "{D3D3D3}"
- #define C_Error 0xB32E2EFF
- #define C_T_Error "{B32E2E}"
- #define C_T_DialogTitle "{348FAD}"
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- // Dialogs //
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- #define D_Username 100
- #define D_Login 200
- #define D_R_Password 300
- #define D_R_Mail 301
- #define D_R_C_Age 302
- #define D_R_C_Gender 303
- #define D_R_C_Origin 304
- #define D_R_C_Accent 305
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- // Fix for gm //
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- main()
- {
- //EMPTY
- }
- #if !defined isnull
- #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
- #endif
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- // Public //
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- public OnGameModeInit()
- {
- SetGameModeText("NCRP - V 1.00.0");
- WriteLog("log_server.txt", "Initialize NCRP Gamemode Version 1.00.0");
- return 1;
- }
- public OnGameModeExit()
- {
- WriteLog("log_server.txt", "Shutting down the GameMode.");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- TogglePlayerSpectating(playerid, 1);
- switch(random(5))
- {
- case 0:
- {
- InterpolateCameraPos(playerid,1006.8538, 282.1343, 85.7583, 1006.8538, 282.1343, 85.7583, 1000, CAMERA_CUT);
- InterpolateCameraLookAt(playerid, 1007.8502, 282.1040, 85.5879, 1007.8502, 282.1040, 85.5879, 1000, CAMERA_CUT);
- }
- case 1:
- {
- InterpolateCameraPos(playerid,646.6002, -594.4451, 15.9723, 646.6002, -594.4451, 15.9723, 1000, CAMERA_CUT);
- InterpolateCameraLookAt(playerid,646.9472, -593.6812, 16.1468, 645.9472, -593.6812, 16.1468, 1000, CAMERA_CUT);
- }
- case 2:
- {
- InterpolateCameraPos(playerid, 651.7802, -494.6155, 30.2279, 651.7802, -494.6155, 30.2279, 1000, CAMERA_CUT);
- InterpolateCameraLookAt(playerid, 652.5730, -493.9993, 29.9173, 652.5730, -493.9993, 29.9173, 1000, CAMERA_CUT);
- }
- case 3:
- {
- InterpolateCameraPos(playerid, 187.5941, -217.7278, 1.9320, 187.5941, -217.7278, 1.9320, 1000, CAMERA_CUT);
- InterpolateCameraLookAt(playerid, 188.3079, -217.0226, 2.0968, 188.3079, -217.0226, 2.0968, 1000, CAMERA_CUT);
- }
- default:
- {
- InterpolateCameraPos(playerid, 94.6793, -215.7012, 3.1615, 94.6793, -215.7012, 3.1615, 1000, CAMERA_CUT);
- InterpolateCameraLookAt(playerid, 94.1885, -216.5767, 3.2614, 94.1885, -216.5767, 3.2614, 1000, CAMERA_CUT);
- }
- }
- lr_OnPlayerConnect(playerid);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new logfile[255], logtext[255], username[24], dreason[3][] = { "Unknown(Timeout or crash)", "Manual Exit", "Admin Kick" };
- GetPlayerName(playerid, username, sizeof(username));
- format(logfile, 255, "%s/log.txt", username);
- format(logtext, 255, "%s disconnected from the server for %s.", username, dreason[reason]);
- WriteLog(logfile, logtext);
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case D_Login:
- {
- lr_D_Login(playerid, response, inputtext);
- }
- case D_R_Password:
- {
- lr_D_R_Password(playerid, response, inputtext);
- }
- case D_R_Mail:
- {
- lr_D_R_Mail(playerid, response, inputtext);
- }
- case D_R_C_Age:
- {
- lr_D_R_C_Age(playerid, response, inputtext);
- }
- case D_R_C_Gender:
- {
- lr_D_R_C_Gender(playerid, response);
- }
- case D_R_C_Origin:
- {
- lr_D_R_C_Origin(playerid, response, inputtext);
- }
- case D_R_C_Accent:
- {
- lr_D_R_C_Age(playerid, response, inputtext);
- }
- }
- return 1;
- }
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- // PlayerName //
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- playername(playerid)
- {
- new pnn[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pnn, sizeof(pnn));
- return pnn;
- }
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- // NumbersInString //
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- stock NumbersInString(const _str_[])
- {
- for (new i, j = strlen(_str_); i != j; i++)
- {
- if ('0' <= _str_[i] <= '9') return 1;
- }
- return 0;
- }
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- // Login & Reg //
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- enum pInformation
- {
- pPassword[255],
- pMail[255],
- pIP_Reg[255],
- pIP_Last[255],
- pStaff[255],
- pAge,
- pGender[255],
- pOrigin[255],
- pAccent[255],
- Float:pPositionX,
- Float:pPositionY,
- Float:pPositionZ,
- Float:pAngle,
- Float:pHealth,
- Float:pArmour,
- pInterior,
- pVirtualWorld,
- pJob,
- pFaction,
- pMoney,
- pLevel
- }
- new Player[MAX_PLAYERS][pInformation],
- PlayerText:Background,
- PlayerText:Loading,
- PlayerText:NewCity,
- PlayerText:Roleplay,
- passwordattemptsleft[MAX_PLAYERS] = 3;
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- INI_String("Password", Player[playerid][pPassword], 255);
- INI_String("Mail", Player[playerid][pMail], 255);
- INI_String("IP_Reg", Player[playerid][pIP_Reg], 255);
- INI_String("IP_Last", Player[playerid][pIP_Last], 255);
- INI_String("Staff", Player[playerid][pStaff], 255);
- INI_Int("Age", Player[playerid][pAge]);
- INI_String("Gender", Player[playerid][pGender], 255);
- INI_String("Origin", Player[playerid][pOrigin], 255);
- INI_String("Accent", Player[playerid][pAccent], 255);
- INI_Float("PositionX", Player[playerid][pPositionX]);
- INI_Float("PositionY", Player[playerid][pPositionY]);
- INI_Float("PositionZ", Player[playerid][pPositionZ]);
- INI_Float("Angle", Player[playerid][pAngle]);
- INI_Float("Health", Player[playerid][pHealth]);
- INI_Float("Armour", Player[playerid][pArmour]);
- INI_Int("Interior", Player[playerid][pInterior]);
- INI_Int("VirtualWorld", Player[playerid][pVirtualWorld]);
- INI_Int("Job", Player[playerid][pJob]);
- INI_Int("Faction", Player[playerid][pFaction]);
- INI_Int("Money", Player[playerid][pMoney]);
- INI_Int("Level", Player[playerid][pLevel]);
- return 1;
- }
- stock UserPath(playerid)
- {
- new string[128], pn[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pn, sizeof(pn));
- format(string, sizeof(string), "%s/account.ini", pn);
- return string;
- }
- stock lr_OnPlayerConnect(playerid)
- {
- passwordattemptsleft[playerid] = 3;
- Background = CreatePlayerTextDraw(playerid,0.000000, 0.000000, "BACKGROUND");
- PlayerTextDrawBackgroundColor(playerid,Background, 255);
- PlayerTextDrawFont(playerid,Background, 1);
- PlayerTextDrawLetterSize(playerid,Background, 5.599997, 52.099998);
- PlayerTextDrawColor(playerid,Background, 255);
- PlayerTextDrawSetOutline(playerid,Background, 0);
- PlayerTextDrawSetProportional(playerid,Background, 1);
- PlayerTextDrawSetShadow(playerid,Background, 1);
- PlayerTextDrawUseBox(playerid,Background, 1);
- PlayerTextDrawBoxColor(playerid,Background, 255);
- PlayerTextDrawTextSize(playerid,Background, 642.000000, 212.000000);
- PlayerTextDrawSetSelectable(playerid,Background, 0);
- Loading = CreatePlayerTextDraw(playerid,261.000000, 260.000000, "Loading..");
- PlayerTextDrawBackgroundColor(playerid,Loading, 255);
- PlayerTextDrawFont(playerid,Loading, 1);
- PlayerTextDrawLetterSize(playerid,Loading, 0.700000, 3.000000);
- PlayerTextDrawColor(playerid,Loading, -1);
- PlayerTextDrawSetOutline(playerid,Loading, 0);
- PlayerTextDrawSetProportional(playerid,Loading, 1);
- PlayerTextDrawSetShadow(playerid,Loading, 1);
- PlayerTextDrawSetSelectable(playerid,Loading, 0);
- NewCity = CreatePlayerTextDraw(playerid,238.000000, 219.000000, "New City");
- PlayerTextDrawAlignment(playerid,NewCity, 2);
- PlayerTextDrawBackgroundColor(playerid,NewCity, 255);
- PlayerTextDrawFont(playerid,NewCity, 1);
- PlayerTextDrawLetterSize(playerid,NewCity, 1.010000, 4.000000);
- PlayerTextDrawColor(playerid,NewCity, 881831423);
- PlayerTextDrawSetOutline(playerid,NewCity, 0);
- PlayerTextDrawSetProportional(playerid,NewCity, 1);
- PlayerTextDrawSetShadow(playerid,NewCity, 1);
- PlayerTextDrawSetSelectable(playerid,NewCity, 0);
- Roleplay = CreatePlayerTextDraw(playerid,395.000000, 220.000000, ": Roleplay");
- PlayerTextDrawAlignment(playerid,Roleplay, 2);
- PlayerTextDrawBackgroundColor(playerid,Roleplay, 255);
- PlayerTextDrawFont(playerid,Roleplay, 1);
- PlayerTextDrawLetterSize(playerid,Roleplay, 1.010000, 4.000000);
- PlayerTextDrawColor(playerid,Roleplay, -774778369);
- PlayerTextDrawSetOutline(playerid,Roleplay, 0);
- PlayerTextDrawSetProportional(playerid,Roleplay, 1);
- PlayerTextDrawSetShadow(playerid,Roleplay, 1);
- PlayerTextDrawSetSelectable(playerid,Roleplay, 0);
- PlayerTextDrawShow(playerid, Background);
- PlayerTextDrawShow(playerid, Loading);
- PlayerTextDrawShow(playerid, NewCity);
- PlayerTextDrawShow(playerid, Roleplay);
- SetTimerEx("EndLoadingScreen", 3500, false, "i", playerid);
- }
- forward EndLoadingScreen(playerid);
- public EndLoadingScreen(playerid)
- {
- PlayerTextDrawHide(playerid, Background);
- PlayerTextDrawHide(playerid, Loading);
- PlayerTextDrawHide(playerid, NewCity);
- PlayerTextDrawHide(playerid, Roleplay);
- for(new i = 0; i < 20; i++)
- {
- SendClientMessage(playerid, C_Default, " ");
- }
- if(NumbersInString(playername(playerid)) == 0)
- {
- if(strfind(playername(playerid), "_", true) != -1)
- {
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Login", ""C_T_Default"Welcome back to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nIn order to contine, Enter your password below.", "Login", "Exit");
- new logfile[255], logtext[255];
- format(logfile, 255, "%s/log.txt", playername(playerid));
- format(logtext, 255, "%s connected to the server.", playername(playerid));
- WriteLog(logfile, logtext);
- }
- else
- {
- new dir_n[MAX_PLAYER_NAME + 13] = "scriptfiles\\";
- strcat(dir_n, playername(playerid));
- dir_create(dir_n);
- ShowPlayerDialog(playerid, D_R_Password, DIALOG_STYLE_PASSWORD, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Register", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nWe noticed that you're a new user.\nTo contine enter your password.", "Contine", "Quit");
- new logfile[255], logtext[255];
- format(logfile, 255, "%s/log.txt", playername(playerid));
- format(logtext, 255, "%s connected to the server.", playername(playerid));
- WriteLog(logfile, logtext);
- }
- }
- else
- {
- ShowPlayerDialog(playerid, D_Username, DIALOG_STYLE_INPUT, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Invalid Name", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nIn order to play here, you must have a valid roleplay name.\nYou will be asked a few questions about roleplaying to make sure you actually can roleplay, Else will you get help by an advisor.\n\n"C_T_Error"Enter your name as John_Doe.", "Check", "Exit");
- }
- }
- else
- {
- ShowPlayerDialog(playerid, D_Username, DIALOG_STYLE_INPUT, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Invalid Name", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nIn order to play here, you must have a valid roleplay name.\nYou will be asked a few questions about roleplaying to make sure you actually can roleplay, Else will you get help by an advisor.\n\n"C_T_Error"Enter your name as John_Doe.", "Check", "Exit");
- }
- return 1;
- }
- stock lr_D_Login(playerid, response, inputtext[])
- {
- if(response)
- {
- if(!isnull(inputtext))
- {
- if(!strcmp(inputtext, Player[playerid][pPassword]))
- {
- SpawnPlayer(playerid);
- PlayerTextDrawShow(playerid, Background);
- PlayerTextDrawShow(playerid, Loading);
- PlayerTextDrawShow(playerid, NewCity);
- PlayerTextDrawShow(playerid, Roleplay);
- SetTimerEx("EndLoadingScreen20", 3500, false, "i", playerid);
- }
- else
- {
- passwordattemptsleft[playerid]--;
- if(passwordattemptsleft[playerid] != 0)
- {
- new dialogtext[255];
- format(dialogtext, 255, ""C_T_Default"Welcome back to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nIn order to contine, Enter your password below.\n\n"C_T_Error"You entered the wrong password! (%i/3 attempts left)", passwordattemptsleft[playerid]);
- ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Login", dialogtext, "Login", "Exit");
- }
- else
- {
- KickPlayer(playerid, "\"Entered over 3 invalid passwords.\"");
- }
- }
- }
- else
- {
- ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Login", ""C_T_Default"Welcome back to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nIn order to contine, Enter your password below.\n\n"C_T_Error"You forgot to insert a password.", "Login", "Exit");
- }
- }
- else
- {
- KickPlayer(playerid, "\"Pressed Exit on Login.\"");
- }
- }
- stock lr_D_R_Password(playerid, response, inputtext[])
- {
- if(response)
- {
- if(!isnull(inputtext))
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "account");
- INI_WriteString(File, "Password", inputtext, 255);
- INI_Close(File);
- ShowPlayerDialog(playerid, D_R_Mail, DIALOG_STYLE_INPUT, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Mail", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nPlease enter your mail in order to be able to confirm your account within 7 days.", "Contine", "Exit");
- }
- else
- {
- ShowPlayerDialog(playerid, D_R_Password, DIALOG_STYLE_PASSWORD, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Register", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nWe noticed that you're a new user.\nTo contine enter your password.\n\n"C_T_Error"You didn't enter a password.", "Contine", "Quit");
- }
- }
- else
- {
- KickPlayer(playerid, "\"Pressed Exit on Register.\"");
- }
- }
- stock lr_D_R_Mail(playerid, response, inputtext[])
- {
- if(response)
- {
- if(!isnull(inputtext))
- {
- if(strfind(inputtext, "@", true) != -1)
- {
- if(strfind(inputtext, ".", true) != -1)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "account");
- INI_WriteString(File, "Mail", inputtext, 255);
- INI_Close(File);
- ShowPlayerDialog(playerid, D_R_C_Age, DIALOG_STYLE_INPUT, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Character Age", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nHow old are your character? He/she must be over 17 and under 60.", "Contine", "Exit");
- }
- else
- {
- ShowPlayerDialog(playerid, D_R_Mail, DIALOG_STYLE_INPUT, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Mail", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nPlease enter your mail in order to be able to confirm your account within 7 days.\n\n"C_T_Error"You entered a invalid mail.", "Contine", "Exit");
- }
- }
- else
- {
- ShowPlayerDialog(playerid, D_R_Mail, DIALOG_STYLE_INPUT, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Mail", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nPlease enter your mail in order to be able to confirm your account within 7 days.\n\n"C_T_Error"You entered a invalid mail.", "Contine", "Exit");
- }
- }
- else
- {
- ShowPlayerDialog(playerid, D_R_Mail, DIALOG_STYLE_INPUT, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Mail", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nPlease enter your mail in order to be able to confirm your account within 7 days.\n\n"C_T_Error"You didn't enter a mail.", "Contine", "Exit");
- }
- }
- else
- {
- KickPlayer(playerid, "\"Pressed Exit on Mail.\"");
- }
- }
- stock lr_D_R_C_Age(playerid, response, inputtext[])
- {
- if(response)
- {
- if(!isnull(inputtext))
- {
- if(inputtext > 16 || inputtext < 61)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "character");
- INI_WriteInt(File, "Age", inputtext);
- INI_Close(File);
- ShowPlayerDialog(playerid, D_R_C_Gender, DIALOG_STYLE_MSGBOX, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Character Gender", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nPlease press your characters gender.", "Male", "Female");
- }
- else
- {
- ShowPlayerDialog(playerid, D_R_C_Age, DIALOG_STYLE_INPUT, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Character Age", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nHow old are your character? He/she must be over 17 and under 60.\n\nYou didn't enter an age!", "Contine", "Exit");
- }
- }
- else
- {
- ShowPlayerDialog(playerid, D_R_C_Age, DIALOG_STYLE_INPUT, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Character Age", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nHow old are your character? He/she must be over 17 and under 60.\n\n"C_T_Error"You forgot to enter an age.", "Contine", "Exit");
- }
- }
- else
- {
- KickPlayer(playerid, "\"Pressed Exit on Character Age.\"");
- }
- }
- stock D_R_C_Gender(playerid, response)
- {
- if(response)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "character");
- INI_WriteInt(File, "Gender", 1);
- INI_Close(File);
- ShowPlayerDialog(playerid, D_R_C_Origin, DIALOG_STYLE_INPUT, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Character Origin", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nPlease enter your characters origin, Basically where he was born.", "Contine", "Exit");
- }
- else
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "character");
- INI_WriteInt(File, "Gender", 2);
- INI_Close(File);
- ShowPlayerDialog(playerid, D_R_C_Origin, DIALOG_STYLE_INPUT, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Character Origin", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nPlease enter your characters origin, Basically where she was born.", "Contine", "Exit");
- }
- }
- stock lr_D_R_C_Origin(playerid, response, inputtext[])
- {
- if(response)
- {
- if(!isnull(inputtext))
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "character");
- INI_WriteString(File, "Origin", inputtext);
- INI_Close(File);
- ShowPlayerDialog(playerid, D_R_C_Accent, DIALOG_STYLE_INPUT, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Character Accent", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nPlease enter your characters accent, Basically the way they speak.", "Contine", "Exit");
- }
- else
- {
- ShowPlayerDialog(playerid, D_R_C_Origin, DIALOG_STYLE_INPUT, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Character Origin", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nPlease enter your characters origin, Basically where he/she was born.\n\n"C_T_Error"You forgot to insert the place of birth.", "Contine", "Exit");
- }
- }
- else
- {
- KickPlayer(playerid, "\"Pressed Exit on Character Origin.\"");
- }
- }
- stock D_R_C_Accent(playerid, response, inputtext[])
- {
- if(response)
- {
- if(!isnull(inputtext))
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "character");
- INI_WriteString(File, "Accent", inputtext);
- INI_Close(File);
- TogglePlayerSpectating(playerid, 0);
- SpawnPlayer(playerid);
- PlayerTextDrawShow(playerid, Background);
- PlayerTextDrawShow(playerid, Loading);
- PlayerTextDrawShow(playerid, NewCity);
- PlayerTextDrawShow(playerid, Roleplay);
- SetTimerEx("EndLoadingScreen30", 3500, false, "i", playerid);
- SetPlayerPos(playerid, 1743.1300, -1861.9683, 13.5769);
- SetPlayerFacingAngle(playerid, 359.2573);
- GivePlayerMoney(playerid, 25000);
- }
- else
- {
- ShowPlayerDialog(playerid, D_R_C_Accent, DIALOG_STYLE_INPUT, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Character Accent", ""C_T_Default"Welcome to "C_T_DialogTitle"New City"C_T_Default": Roleplay.\nPlease enter your characters accent, Basically the way they speak.\n\n"C_T_Error"You forgot to enter the accent.", "Contine", "Exit");
- }
- }
- else
- {
- KickPlayer(playerid, "\"Pressed Exit on Character Accent.\"");
- }
- }
- forward EndLoadingScreen30(playerid);
- public EndLoadingScreen30(playerid)
- {
- PlayerTextDrawHide(playerid, Background);
- PlayerTextDrawHide(playerid, Loading);
- PlayerTextDrawHide(playerid, NewCity);
- PlayerTextDrawHide(playerid, Roleplay);
- if(Player[playerid][pGender] == 2)
- {
- //ShowPlayerDialog(playerid, 0, DIALOG_STYLE_PREVMODEL, "DIALOG_STYLE_PREVMODEL_LIST - skin selection test", "9\n \n10\n \n11\n \n12\n \n13\n \n31\n \n39\n \n40\n \n41\n \n53\n \n54\n \n55\n \n56\n \n63\n \n64\n \n65\n \n69\n \n75\n \n76\n \n77\n \n85\n \n87\n \n88\n \n89\n \n90\n \n91\n \n92\n \n93\n \n129\n \n130\n \n131\n \n141\n \n", "Select", "");
- }
- else
- {
- }
- return 1;
- }
- forward EndLoadingScreen20(playerid);
- public EndLoadingScreen20(playerid)
- {
- PlayerTextDrawHide(playerid, Background);
- PlayerTextDrawHide(playerid, Loading);
- PlayerTextDrawHide(playerid, NewCity);
- PlayerTextDrawHide(playerid, Roleplay);
- return 1;
- }
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- // CMD: mm //
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- CMD:jetpack(playerid)
- {
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
- return 1;
- }
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- // KickPlayer //
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- stock KickPlayer(playerid, reason[])
- {
- new logfile[255], logtext[255], dialogtext[255];
- format(logfile, 255, "%s/log.txt", playername(playerid));
- format(logtext, 255, "%s was kicked from the server of: %s.", playername(playerid), reason);
- WriteLog(logfile, logtext);
- format(dialogtext, 255, ""C_T_Default"You have been kicked from the server as of %s.\n\n"C_T_Error"You won't be able to login again within 5minutes.", reason);
- ShowPlayerDialog(playerid, D_Username, DIALOG_STYLE_INPUT, ""C_T_DialogTitle"New City Roleplay"C_T_Default": Notice", dialogtext, "Quit", "");
- SetTimerEx("Kicked", 1000, false, "i", playerid);
- }
- forward Kicked(playerid);
- public Kicked(playerid)
- {
- Kick(playerid);
- return 1;
- }
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- // Player Command Log //
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- public OnPlayerCommandPerformed(playerid, cmdtext[], success)
- {
- if(success)
- {
- new logfile[255], logtext[255];
- format(logfile, 255, "%s/log_commands.txt", playername(playerid));
- format(logtext, 255, "%s used %s", playername(playerid), cmdtext);
- WriteLog(logfile, logtext);
- }
- else
- {
- SendClientMessage(playerid, C_Default, "["C_T_Error"Error"C_T_Default"] That command doesn't exist, You can use /mm or /commands for help.");
- }
- return 1;
- }
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- // WriteLog //
- /****************************************************************************/
- //----------------------------------------------------------------------------//
- stock WriteLog(logfile[], text[])
- {
- new File:handle = fopen(logfile, io_append);
- if(handle)
- {
- new logtext[255], Hour, Minute, Second;
- gettime(Hour, Minute, Second);
- format(logtext, 255, "[%02d:%02d:%02d] %s\r\n", Hour, Minute, Second, text);
- fwrite(handle, logtext);
- fclose(handle);
- }
- else
- {
- print("WARNING, WriteLog failed.");
- }
- }
- //----------------------------------------------------------------------------//
- /****************************************************************************/
- //----------------------------------------------------------------------------//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement