Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*- Start of: Include -*/
- #include <a_samp>
- #include <YSI\y_ini>
- #include <zcmd>
- #include <sscanf2>
- /*- Start of: Defines -*/
- #define D_Username 1
- #define D_Login 10
- #define D_Register 20
- #define D_R_Mail 21
- #define D_RC_Age 22
- #define D_RC_Origin 23
- #define D_RC_Gender 24
- #define D_R_Rules 25
- #define U_Path "/acc_%s.ini"
- #if !defined isnull
- #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
- #endif
- /*- Start of: Vars -*/
- enum pStats
- {
- pID,
- pPassword[128],
- pMail[128],
- pAge,
- pOrigin[128],
- pGender[128],
- pSkin,
- pInterior,
- pVW,
- Float:pPositionX,
- Float:pPositionY,
- Float:pPositionZ,
- pMoney,
- pLevel,
- pJob1,
- pJob2,
- pFlags,
- pBanned,
- pBanBy[128],
- pBanReason[128],
- pRegIP[128],
- pLastIP[128],
- pFaction,
- pRank[11]
- }
- enum fStats
- {
- fID,
- fCompleteName[50],
- fShortName[10],
- fLeader[MAX_PLAYER_NAME],
- fMaxRank,
- fRank1[11],
- fRank2[11],
- fRank3[11],
- fRank4[11],
- fRank5[11],
- fRank6[11],
- fRank7[11],
- fRank8[11],
- fRank9[11],
- fRank10[11],
- }
- #define MAX_FACTION 3
- new Factions[MAX_FACTION][fStats];
- new U_Stats[MAX_PLAYERS][pStats];
- /*- Start of: Random -*/
- main()
- {
- print("\n[Launch] NCRP V0.10.0 has been loded.");
- }
- /*- Start of: Public -*/
- public OnGameModeInit()
- {
- CreateVehicles();
- CreateEnters();
- CreateFactions();
- ManualVehicleEngineAndLights();
- EnableStuntBonusForAll(0);
- DisableInteriorEnterExits();
- SetGameModeText("NCRP V0.10.0");
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- INI_Int("ID", U_Stats[playerid][pID]);
- INI_String("Password", U_Stats[playerid][pPassword], 128);
- INI_String("Mail", U_Stats[playerid][pMail], 128);
- INI_Int("Age", U_Stats[playerid][pAge]);
- INI_String("Origin", U_Stats[playerid][pOrigin], 128);
- INI_String("Gender", U_Stats[playerid][pGender], 128);
- INI_Int("Skin", U_Stats[playerid][pSkin]);
- INI_Int("Interior", U_Stats[playerid][pInterior]);
- INI_Int("VW", U_Stats[playerid][pVW]);
- INI_Float("PositionX", U_Stats[playerid][pPositionX]);
- INI_Float("PositionY", U_Stats[playerid][pPositionY]);
- INI_Float("PositionZ", U_Stats[playerid][pPositionZ]);
- INI_Int("Money", U_Stats[playerid][pMoney]);
- INI_Int("Level", U_Stats[playerid][pLevel]);
- INI_Int("Job1", U_Stats[playerid][pJob1]);
- INI_Int("Job2", U_Stats[playerid][pJob2]);
- INI_Int("Flags", U_Stats[playerid][pFlags]);
- INI_Int("Banned", U_Stats[playerid][pBanned]);
- INI_String("BanBy", U_Stats[playerid][pBanBy], 128);
- INI_String("BanReason", U_Stats[playerid][pBanReason], 128);
- INI_String("RegIP", U_Stats[playerid][pRegIP], 128);
- INI_String("LastIP", U_Stats[playerid][pLastIP], 128);
- INI_Int("Faction", U_Stats[playerid][pFaction]);
- INI_String("Rank", U_Stats[playerid][pRank], 11);
- return 1;
- }
- forward LoadFaction_data(factionid, name[], value[]);
- public LoadFaction_data(factionid, name[], value[]) // faction load data
- {
- INI_Int("ID",Factions[factionid][fID]);
- INI_String("CompleteName",Factions[factionid][fCompleteName], 50);
- INI_String("ShortName",Factions[factionid][fShortName], 10);
- INI_String("Leader",Factions[factionid][fLeader], MAX_PLAYER_NAME);
- INI_Int("MaxRank",Factions[factionid][fMaxRank]);
- INI_String("Rank1",Factions[factionid][fRank1], 11);
- INI_String("Rank2",Factions[factionid][fRank2], 11);
- INI_String("Rank3",Factions[factionid][fRank3], 11);
- INI_String("Rank4",Factions[factionid][fRank4], 11);
- INI_String("Rank5",Factions[factionid][fRank5], 11);
- INI_String("Rank6",Factions[factionid][fRank6], 11);
- INI_String("Rank7",Factions[factionid][fRank7], 11);
- INI_String("Rank8",Factions[factionid][fRank8], 11);
- INI_String("Rank9",Factions[factionid][fRank9], 11);
- INI_String("Rank10",Factions[factionid][fRank10], 11);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SetTimerEx("OnPlayerConnectCamera", 100, false, "d", playerid);
- for(new i; i!=20; i++)
- {
- SendClientMessage(playerid, -1, "");
- }
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- if(IsARolePlayName(name) == 1)
- {
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD,"{82CAFF}New City Roleplay{FFFFFF}: Login","{FFFFFF}Welcome back to {82CAFF}New City Roleplay{FFFFFF}. This name seems to be registrated.\nIf you're the owner of this account, Please proceed by entering your password.","Login","");
- }
- else
- {
- ShowPlayerDialog(playerid, D_Register, DIALOG_STYLE_PASSWORD,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}, It seems like this account isn't registrated yet! Enter a password below to contine the registration.",">>","");
- }
- }
- else
- {
- ShowPlayerDialog(playerid, D_Username, DIALOG_STYLE_INPUT, "{82CAFF}New City Roleplay{FFFFFF}: Invalid Username", "{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}, We just met a little problem, Your name isn't allowed.\n\nEnter a new roleplay name such as: John_Doe", ">>", "");
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case D_Username:
- {
- if(!response)
- {
- Kick(playerid);
- }
- else
- {
- if(!strlen(inputtext))
- {
- Kick(playerid);
- }
- else
- {
- SetPlayerName(playerid, inputtext);
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- if(IsARolePlayName(name) == 1)
- {
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD,"{82CAFF}New City Roleplay{FFFFFF}: Login","{FFFFFF}Welcome back to {82CAFF}New City Roleplay{FFFFFF}. This name seems to be registrated.\nIf you're the owner of this account, Please proceed by entering your password.","Login","");
- }
- else
- {
- ShowPlayerDialog(playerid, D_Register, DIALOG_STYLE_PASSWORD,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}, It seems like this account isn't registrated yet!\nEnter a password below to contine the registration.",">>","");
- }
- }
- else
- {
- ShowPlayerDialog(playerid, D_Username, DIALOG_STYLE_INPUT, "{82CAFF}New City Roleplay{FFFFFF}: Invalid Username", "{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}, We just met a little problem, Your name isn't allowed.\n\nEnter a new roleplay name such as: John_Doe", ">>", "");
- }
- }
- }
- }
- case D_Login:
- {
- if(!response)
- {
- Kick ( playerid );
- }
- else
- {
- if(!strlen(inputtext))
- {
- ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD,"{82CAFF}New City Roleplay{FFFFFF}: Login","{FFFFFF}Welcome back to {82CAFF}New City Roleplay{FFFFFF}. This name seems to be registrated.\nIf you're the owner of this account, Please proceed by entering your password.","Login","");
- }
- else
- {
- if(!strcmp(inputtext, U_Stats[playerid][pPassword]))
- {
- SpawnPlayer(playerid);
- SetSpawnInfo( playerid, 0, U_Stats[playerid][pSkin], U_Stats[playerid][pPositionX], U_Stats[playerid][pPositionY], U_Stats[playerid][pPositionZ], 269.15, 0, 0, 0, 0, 0, 0 );
- TogglePlayerSpectating(playerid, 0);
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- SpawnPlayer(playerid);
- SetPlayerSkin(playerid, U_Stats[playerid][pSkin]);
- SetPlayerInterior(playerid, U_Stats[playerid][pInterior]);
- SetPlayerVirtualWorld(playerid, U_Stats[playerid][pVW]);
- SetPlayerPos(playerid, U_Stats[playerid][pPositionX], U_Stats[playerid][pPositionY], U_Stats[playerid][pPositionZ]);
- GivePlayerMoney(playerid, U_Stats[playerid][pMoney]);
- SetPlayerScore(playerid, U_Stats[playerid][pLevel]);
- SpawnPlayer(playerid);
- }
- else
- {
- ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD,"{82CAFF}New City Roleplay{FFFFFF}: Login","{FFFFFF}Welcome back to {82CAFF}New City Roleplay{FFFFFF}. This name seems to be registrated.\nIf you're the owner of this account, Please proceed by entering your password.\n\n{FFFF00}You entered the wrong password!","Login","");
- }
- }
- return 1;
- }
- }
- case D_Register:
- {
- if(!response)
- {
- Kick ( playerid );
- }
- else
- {
- if(!strlen(inputtext))
- {
- ShowPlayerDialog(playerid, D_Register, DIALOG_STYLE_PASSWORD,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}, It seems like this account isn't registrated yet!\nEnter a password below to contine the registration.\n\n{FFFF00}You forgot to insert a password.",">>","");
- }
- else
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "data");
- INI_WriteString(File, "Password", inputtext);
- INI_Close(File);
- ShowPlayerDialog(playerid, D_R_Mail, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nWhat is your email? You may decide if you want to receive news letters or not.\nIf you don't, Simply leave it empty.",">>","");
- }
- return 1;
- }
- }
- case D_R_Mail:
- {
- if(!response)
- {
- ShowPlayerDialog(playerid, D_R_Mail, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nWhat is your email? You may decide if you want to receive news letters or not.\nIf you don't, Simply leave it empty.",">>","");
- }
- else
- {
- if(!strlen(inputtext))
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "data");
- INI_WriteString(File, "Mail", "empty");
- INI_Close(File);
- ShowPlayerDialog(playerid, D_RC_Age, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nHow old are your character? Not you, The character.\nEnter an age below 60 and over 17.",">>","");
- }
- else
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "data");
- INI_WriteString(File, "Mail", inputtext);
- INI_Close(File);
- ShowPlayerDialog(playerid, D_RC_Age, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nHow old are your character? Not you, The character.\nEnter an age below 60 and over 17.",">>","");
- }
- return 1;
- }
- }
- case D_RC_Age:
- {
- if(!response)
- {
- ShowPlayerDialog(playerid, D_RC_Age, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nHow old are your character? Not you, The character.\nEnter an age below 60 and over 17.",">>","");
- }
- else
- {
- if(!strlen(inputtext))
- {
- ShowPlayerDialog(playerid, D_RC_Age, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nHow old are your character? Not you, The character.\nEnter an age below 60 and over 17.\n\n{FFFF00}You forgot to enter an age.",">>","");
- }
- else
- {
- if(strval(inputtext) > 16 && strval(inputtext) < 61)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "data");
- INI_WriteInt(File, "Age", strval(inputtext));
- INI_Close(File);
- ShowPlayerDialog(playerid, D_RC_Origin, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nWhere are your character borned? Enter it below!",">>","");
- }
- else
- {
- ShowPlayerDialog(playerid, D_RC_Age, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nHow old are your character? Not you, The character.\nEnter an age below 60 and over 17.\n\n{FFFF00}You need to be below 60 and 17!",">>","");
- }
- }
- return 1;
- }
- }
- case D_RC_Origin:
- {
- if(!response)
- {
- ShowPlayerDialog(playerid, D_RC_Origin, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nWhere are your character borned? Enter it below!",">>","");
- }
- else
- {
- if(!strlen(inputtext))
- {
- ShowPlayerDialog(playerid, D_RC_Origin, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nWhere are your character borned? Enter it below!\n\nYou forgot to enter the origin!",">>","");
- }
- else
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "data");
- INI_WriteString(File, "Origin", inputtext);
- INI_Close(File);
- ShowPlayerDialog(playerid, D_RC_Gender, DIALOG_STYLE_MSGBOX,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nWhat gender are your character? Press the buttons to choose.","Male","Female");
- }
- return 1;
- }
- }
- case D_RC_Gender:
- {
- if(!response)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "data");
- INI_WriteString(File, "Gender", "Female");
- INI_Close(File);
- new strca[3000];
- strcat(strca, "{FFFFFF}- {8C1717}Deathmatching{FFFFFF} You are not allowed to deathmatch anyone, Even if they did something to you OOC, You will be punished.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Hacking{FFFFFF} Using anything of a 3rd party program will get you IP-Banned for ever.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Powergaming{FFFFFF} You may not force any action towards a player, Always use some kind of Succes/Failure.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Metagaming{FFFFFF} You're not allowed to metagame, This means you cannot mix OOC Information with IC\n");
- strcat(strca, "{FFFFFF}- {8C1717}Revenge Killing{FFFFFF} If someone killed you, You cannot go back and kill them as revenge, Remember that you forget 30minutes of your past life after death.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Car Ramming{FFFFFF} This rule is tricky, You're allowed to ram someone, But you need to roleplay it correctly, without powergaming.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Spamming{FFFFFF} We don't like spammers, neither do roleplayers, Doing so will result a 15 minute kick to calm down.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Non RP Conducts{FFFFFF} GTA SA:MP Roleplay isn't just about getting money, beeing a \"gangster\", beeing a faction, It's about to actually Roleplay -..\n");
- strcat(strca, " -.. so we suggest you to not just be a criminal, It's not against the rules, we just don't want everyone to run around with weapons, robbing newbies and other people. Play fair.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Insulting/Harrasing{FFFFFF} Don't harrass any one in our server, Be nice, friednly. We do not accept any bad attitude.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Bunny jumping{FFFFFF} You may npt Bunny Jump, This is to jump while running to get faster to your destiny.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Begging{FFFFFF} Don't beg for any sort of membership such as VIP, Admin, Helper, and etc, Doing this will result an account flag.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Ninja jacking{FFFFFF} This is sort of Powergaming, Simple taking a car with someone in it without any roleplay.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Revenge Killing{FFFFFF} If someone killed you, You cannot go back and kill them as revenge, Remember that you forget 30minutes of your past life after death.\n");
- strcat(strca, "{FFFFFF} There's of course more rules that's not written here, If you're insecure, You can simply use /a(dmin)m(essage) or /m(oderator)m(essage)");
- ShowPlayerDialog(playerid, D_R_Rules, DIALOG_STYLE_MSGBOX,"{82CAFF}New City Roleplay{FFFFFF}: Rules",strca,"Accept rules","");
- }
- else
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "data");
- INI_WriteString(File, "Gender", "Male");
- INI_Close(File);
- new strca[3000];
- strcat(strca, "{FFFFFF}- {8C1717}Deathmatching{FFFFFF} You are not allowed to deathmatch anyone, Even if they did something to you OOC, You will be punished.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Hacking{FFFFFF} Using anything of a 3rd party program will get you IP-Banned for ever.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Powergaming{FFFFFF} You may not force any action towards a player, Always use some kind of Succes/Failure.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Metagaming{FFFFFF} You're not allowed to metagame, This means you cannot mix OOC Information with IC\n");
- strcat(strca, "{FFFFFF}- {8C1717}Revenge Killing{FFFFFF} If someone killed you, You cannot go back and kill them as revenge, Remember that you forget 30minutes of your past life after death.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Car Ramming{FFFFFF} This rule is tricky, You're allowed to ram someone, But you need to roleplay it correctly, without powergaming.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Spamming{FFFFFF} We don't like spammers, neither do roleplayers, Doing so will result a 15 minute kick to calm down.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Non RP Conducts{FFFFFF} GTA SA:MP Roleplay isn't just about getting money, beeing a \"gangster\", beeing a faction, It's about to actually Roleplay -..\n");
- strcat(strca, " -.. so we suggest you to not just be a criminal, It's not against the rules, we just don't want everyone to run around with weapons, robbing newbies and other people. Play fair.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Insulting/Harrasing{FFFFFF} Don't harrass any one in our server, Be nice, friednly. We do not accept any bad attitude.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Bunny jumping{FFFFFF} You may npt Bunny Jump, This is to jump while running to get faster to your destiny.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Begging{FFFFFF} Don't beg for any sort of membership such as VIP, Admin, Helper, and etc, Doing this will result an account flag.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Ninja jacking{FFFFFF} This is sort of Powergaming, Simple taking a car with someone in it without any roleplay.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Revenge Killing{FFFFFF} If someone killed you, You cannot go back and kill them as revenge, Remember that you forget 30minutes of your past life after death.\n");
- strcat(strca, "{FFFFFF} There's of course more rules that's not written here, If you're insecure, You can simply use /a(dmin)m(essage) or /m(oderator)m(essage)");
- ShowPlayerDialog(playerid, D_R_Rules, DIALOG_STYLE_MSGBOX,"{82CAFF}New City Roleplay{FFFFFF}: Rules",strca,"Accept rules","");
- return 1;
- }
- }
- case D_R_Rules:
- {
- if(response)
- {
- TogglePlayerSpectating(playerid, 0);
- SetSpawnInfo(playerid, 0, 17, 1743.1300, -1861.9683, 13.5769, 359.2573, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- GivePlayerMoney(playerid, 25000);
- SetPlayerScore(playerid, 1);
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "data");
- INI_WriteInt(File, "Skin", 17);
- INI_WriteInt(File, "Interior", 0);
- INI_WriteInt(File, "VW", 0);
- INI_WriteFloat(File, "PositionX", 1743.1300);
- INI_WriteFloat(File, "PositionY", -1861.9683);
- INI_WriteFloat(File, "PositionZ", 13.5769);
- INI_WriteInt(File, "Money", 25000);
- INI_WriteInt(File, "Level", 1);
- INI_WriteInt(File, "Job1", 0);
- INI_WriteInt(File, "Job2", 0);
- INI_WriteInt(File, "Flags", 0);
- INI_WriteInt(File, "Banned", 0);
- INI_WriteString(File, "BanBy", "0");
- INI_WriteString(File, "BanReason", "0");
- new plrIP[16];
- GetPlayerIp(playerid, plrIP, sizeof(plrIP));
- INI_WriteString(File, "RegIP", plrIP);
- INI_WriteString(File, "LastIP", plrIP);
- INI_WriteInt(File, "Faction", 0);
- INI_WriteString(File, "Rank", "None");
- INI_Close(File);
- SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}NCRP{FFFFFF}] Welcome to New City Roleplay! Are you in need of help? Feel free to use /m(oderator)m(essage)!");
- SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}NCRP{FFFFFF}] You may use /o(oc)c(hat) to chat globaly.");
- new message[255];
- new name[MAX_PLAYER_NAME];
- format(message, 255, "{FFFFFF}[{82CAFF}NCRP{FFFFFF}] Welcome our newest user %s to NCRP!", GetPlayerName(playerid, name, sizeof(name)));
- SendClientMessageToAll(-1, message);
- return 1;
- }
- }
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "data");
- INI_WriteInt(File, "Skin", GetPlayerSkin(playerid));
- INI_WriteInt(File, "Interior", GetPlayerInterior(playerid));
- INI_WriteInt(File, "VW", GetPlayerVirtualWorld(playerid));
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- INI_WriteFloat(File, "PositionX", x);
- INI_WriteFloat(File, "PositionY", y);
- INI_WriteFloat(File, "PositionZ", z);
- INI_WriteInt(File, "Money", GetPlayerMoney(playerid));
- INI_WriteInt(File, "Level", GetPlayerScore(playerid));
- INI_WriteInt(File, "Job1", U_Stats[playerid][pJob1]);
- INI_WriteInt(File, "Job2", U_Stats[playerid][pJob2]);
- INI_WriteInt(File, "Flags", U_Stats[playerid][pFlags]);
- INI_WriteInt(File, "Banned", U_Stats[playerid][pBanned]);
- INI_WriteString(File, "BanBy", U_Stats[playerid][pBanBy]);
- INI_WriteString(File, "BanReason", U_Stats[playerid][pBanReason]);
- new plrIP[16];
- GetPlayerIp(playerid, plrIP, sizeof(plrIP));
- INI_WriteString(File, "LastIP", plrIP);
- INI_WriteInt(File, "Faction", U_Stats[playerid][pFaction]);
- INI_Close(File);
- return 1;
- }
- forward OnPlayerConnectCamera(playerid);
- public OnPlayerConnectCamera(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);
- }
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if((newkeys == KEY_SECONDARY_ATTACK) && (oldkeys == 0) && IsPlayerInRangeOfPoint(playerid, 2.0, 1081.2261, -1697.9417, 13.5469)) // employment agency - enter
- {
- GameTextForPlayer(playerid, "Loading objects..", 1750, 6);
- TogglePlayerControllable(playerid, 0);
- SetPlayerPos(playerid, 384.808624, 173.804992, 1008.382812);
- SetPlayerInterior(playerid, 3);
- SetTimerEx("EE", 1750, false, "i", playerid);
- return 1;
- }
- if((newkeys == KEY_SECONDARY_ATTACK) && (oldkeys == 0) && IsPlayerInRangeOfPoint(playerid, 2.25, 384.808624, 173.804992, 1008.382812)) // employment agency - exit
- {
- GameTextForPlayer(playerid, "Loading objects..", 1750, 6);
- TogglePlayerControllable(playerid, 0);
- SetPlayerPos(playerid, 1081.2261, -1697.9417, 13.5469);
- SetPlayerInterior(playerid, 0);
- SetTimerEx("EE", 1750, false, "i", playerid);
- return 1;
- }
- return 1;
- }
- forward EE(playerid);
- public EE(playerid)
- {
- TogglePlayerControllable(playerid, 1);
- }
- /*- Start of: Admin Commands -*/
- CMD:avehicle(playerid, params[])
- {
- if(U_Stats[playerid][pLevel] > 12)
- {
- new vmod;
- if(sscanf(params, "i", vmod))
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}Error{FFFFFF}] You forgot to insert a vehicle model.");
- }
- else
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- CreateVehicle(vmod, x, y, z, 82.2873, -1, -1, -1);
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}Error{FFFFFF}] You're not high admin enough.");
- }
- return 1;
- }
- CMD:atp(playerid, params[])
- {
- if(U_Stats[playerid][pLevel] > 12)
- {
- new player, to[128];
- if(sscanf(params, "us", player, to))
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}Error{FFFFFF}] You forgot to insert a player/destiny.");
- }
- else
- {
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}Error{FFFFFF}] The player is offline.");
- else
- {
- if(!strcmp(to, "ea"))
- {
- SetPlayerPos(player, 1081.2261, -1697.9417, 13.5469);
- SetPlayerInterior(player, 0);
- }
- }
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}Error{FFFFFF}] You're not high admin enough.");
- }
- return 1;
- }
- /*- Start of: Normal Commands -*/
- CMD:enter(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 12.5, 1081.2261, -1697.9417, 13.5469))
- {
- GameTextForPlayer(playerid, "Loading objects..", 1750, 6);
- TogglePlayerControllable(playerid, 0);
- SetPlayerPos(playerid, 384.808624, 173.804992, 1008.382812);
- SetPlayerInterior(playerid, 3);
- SetTimerEx("EE", 1750, false, "i", playerid);
- }
- return 1;
- }
- /*- Start of: Stocks -*/
- stock UserPath(playerid)
- {
- new
- string[128],
- playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, sizeof(playername));
- format(string, sizeof(string), U_Path, playername);
- return string;
- }
- stock IsARolePlayName(name[])
- {
- new
- szLastCell,
- bool: bUnderScore;
- for(new i; i < strlen(name); i++)
- {
- if(name[i] == '_')
- {
- if(bUnderScore == true)
- {
- return 0;
- }
- bUnderScore = true;
- }
- else if(!szLastCell || szLastCell == '_')
- {
- if(name[i] < 'A' || name[i] > 'Z')
- {
- return 0;
- }
- }
- else
- {
- if(name[i] < 'a' || name[i] > 'z')
- return 0;
- }
- szLastCell = name[i];
- }
- if(bUnderScore == false)
- return 0;
- return 1;
- }
- stock CreateVehicles()
- {
- AddStaticVehicle(420,1792.4155,-1867.6967,13.3874,358.8062,6,6); // Taxi Unity #1
- AddStaticVehicle(420,1797.1969,-1867.6871,13.3912,358.9693,6,6); // Taxi Unity #2
- AddStaticVehicle(420,1802.4940,-1867.6484,13.3940,358.8062,6,6); // Taxi Unity #3
- AddStaticVehicle(420,1807.8152,-1867.7207,13.4007,358.8062,6,6); // Taxi Unity #4
- AddStaticVehicle(428,1542.6244,-1024.6200,24.0320,163.2065,4,75); // Chuff #1
- AddStaticVehicle(428,1546.4946,-1026.1895,24.0301,163.4733,4,75); // Chuff #2
- AddStaticVehicle(428,1551.0212,-1027.5726,24.0321,162.4711,15,28); // Chuff #3
- AddStaticVehicle(428,1555.1923,-1028.6541,24.0309,162.7516,88,94); // Chuff #4
- AddStaticVehicle(428,1559.5815,-1029.7976,24.0310,163.7259,53,54); // Chuff #5
- AddStaticVehicle(428,1563.8594,-1031.3964,24.0355,163.6010,40,77); // Chuff #6
- }
- stock CreateEnters()
- {
- Create3DTextLabel("- Los Santos Employment Agency -\n Press F to enter", 0xffffffff, 1081.2261, -1697.9417, 13.5469, 40.0, 0, 0); // Los Santos - Job enter | 1081.2261, -1697.9417, 13.5469
- AddStaticPickup(1239, 1, 1081.2261, -1697.9417, 13.5469, 0); // Los Santos - Job enter | 1081.2261, -1697.9417, 13.5469
- Create3DTextLabel("- Los Santos Employment Agency -\n Press F to exit", 0xffffffff, 1702.0747, -1667.7676, 20.2188, 40.0, 1, 0); // Los Santos - Job exit | 1702.0747, -1667.7676, 20.2188
- AddStaticPickup(1239, 1, 1702.0747, -1667.7676, 20.2188, 1); // Los Santos - Job exit | 1702.0747, -1667.7676, 20.2188
- Create3DTextLabel("- JOB 1 -", 0xffffffff, 1734.4955, -1660.0510, 23.7309, 10.0, 1, 0); // Los Santos - EA - JOB 1 | 1734.4955, -1660.0510, 23.7183
- AddStaticPickup(1239, 1, 1734.4955, -1660.0510, 23.7309, 1);
- Create3DTextLabel("- JOB 2 -", 0xffffffff, 1734.4955, -1654.4794, 23.7309, 10.0, 1, 0); // Los Santos - EA - JOB 2 | 1734.4866, -1654.4794, 23.7305
- AddStaticPickup(1239, 1, 1734.4955, -1654.4794, 23.7309, 1);
- Create3DTextLabel("- JOB 3 -", 0xffffffff, 1734.4955, -1648.4071, 23.7309, 10.0, 1, 0); // Los Santos - EA - JOB 3 | 1734.3845, -1648.4071, 23.7438
- AddStaticPickup(1239, 1, 1734.4955, -1648.4071, 23.7309, 1);
- Create3DTextLabel("- JOB 4 -", 0xffffffff, 1734.4955, -1642.4214, 23.7309, 10.0, 1, 0); // Los Santos - EA - JOB 4 | 1734.2845, -1642.4214, 23.7515
- AddStaticPickup(1239, 1, 1734.4955, -1642.4214, 23.7309, 1);
- }
- stock FactionPath(factionID)
- {
- new str[128];
- format(str, sizeof(str), "Factions/%i", factionID);
- return str;
- }
- stock CreateFactions()
- {
- for(new i=0; i<MAX_FACTION; i++)
- {
- if(fexist(FactionPath(i)))
- {
- switch(i)
- {
- case 0:
- {
- Factions[i][fID] = 1;
- Factions[i][fMaxRank] = 8;
- new INI:File = INI_Open(FactionPath(i));
- INI_WriteInt(File,"ID",Factions[i][fID]);
- INI_WriteString(File,"CompleteName","Los Angeles Police Department");
- INI_WriteString(File,"ShortName","L.A.P.D");
- INI_WriteString(File,"Leader","None");
- INI_WriteInt(File,"MaxRank",Factions[i][fMaxRank]);
- INI_WriteString(File,"Rank1","Cadet");
- INI_WriteString(File,"Rank2","Officier 1");
- INI_WriteString(File,"Rank3","Officer 2");
- INI_WriteString(File,"Rank4","Officer 3");
- INI_WriteString(File,"Rank5","Sergeant");
- INI_WriteString(File,"Rank6","Captain");
- INI_WriteString(File,"Rank7","Assistant Chief");
- INI_WriteString(File,"Rank8","Chief");
- INI_WriteString(File,"Rank9","");
- INI_WriteString(File,"Rank10","");
- INI_Close(File);
- }
- case 1:
- {
- Factions[i][fID] = 2;
- Factions[i][fMaxRank] = 7;
- new INI:File = INI_Open(FactionPath(i));
- INI_WriteInt(File,"ID",Factions[i][fID]);
- INI_WriteString(File,"CompleteName","Los Angeles Fire Department");
- INI_WriteString(File,"ShortName","L.A.F.D");
- INI_WriteString(File,"Leader","None");
- INI_WriteInt(File,"MaxRank",Factions[i][fMaxRank]);
- INI_WriteString(File,"Rank1","Cadet");
- INI_WriteString(File,"Rank2","EMS");
- INI_WriteString(File,"Rank3","Firefighter");
- INI_WriteString(File,"Rank4","EMS/Firefighter");
- INI_WriteString(File,"Rank5","Captain");
- INI_WriteString(File,"Rank6","Assistant Chief");
- INI_WriteString(File,"Rank7","Chief");
- INI_WriteString(File,"Rank8","");
- INI_WriteString(File,"Rank9","");
- INI_WriteString(File,"Rank10","");
- INI_Close(File);
- }
- case 2:
- {
- Factions[i][fID] = 3;
- Factions[i][fMaxRank] = 4;
- new INI:File = INI_Open(FactionPath(i));
- INI_WriteInt(File,"ID",Factions[i][fID]);
- INI_WriteString(File,"CompleteName","Fox5");
- INI_WriteString(File,"ShortName","Fox5");
- INI_WriteString(File,"Leader","None");
- INI_WriteInt(File,"MaxRank",Factions[i][fMaxRank]);
- INI_WriteString(File,"Rank1","New Reporter");
- INI_WriteString(File,"Rank2","Heli Reporter");
- INI_WriteString(File,"Rank3","Interview Reporter");
- INI_WriteString(File,"Rank4","Owner");
- INI_WriteString(File,"Rank5","");
- INI_WriteString(File,"Rank6","");
- INI_WriteString(File,"Rank7","");
- INI_WriteString(File,"Rank8","");
- INI_WriteString(File,"Rank9","");
- INI_WriteString(File,"Rank10","");
- INI_Close(File);
- }
- }
- }
- else
- {
- INI_ParseFile(FactionPath(i), "LoadFaction_data", .bExtra = true, .extra = i);
- printf("[Launch] Faction ID : %i Succefuly LOADED", i);
- }
- }
- return 1;
- }
- stock GetName(playerid)
- {
- new gName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, gName, sizeof(gName));
- return gName;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement