Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- //------------------------------------------------------------- \\
- //*** *** *** The Basic Roleplay commands m8. *** *** *** \\
- //------------------------------------------------------------------\\
- // *** LE END OF LE BASIC ROLEPLAY COMMANDS MATE. ((It's probably not, just havn't added them yet. ))
- // *** Logging In, Seting up acount. *** \\
- new string [128];
- format(string, sizeof(string), "{FFFFFF}Welcome To Western County Roleplay, {50BB44}%s.\n{FFFFFF}Type your desired password below to Register.", RemoveUnderScore(playerid));
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Register",string,"Register","Quit");
- return 1;
- }
- stock ShowLoginDialog(playerid)
- {
- new string [128];
- format(string, sizeof(string), "{FFFFFF}Welcome Back, {50BB44}%s.\n{FFFFFF}Type Your below Password To Login.", RemoveUnderScore(playerid));
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login",string,"Login","Quit");
- return 1;
- }
- stock ShowCharacterDialog(playerid)
- {
- new string[128];
- format(string, sizeof(string), "{FFFFFF}Play as {50BB44}%s\n\n{FFFFFF}Profile Settings", PlayerInfo[playerid][Name]);
- ShowPlayerDialog(playerid, DIALOG_CHARSELECT, DIALOG_STYLE_LIST,"Menu",string,"Select","Quit");
- return 1;
- }
- stock ShowCharacterInformation(playerid)
- {
- new string[128];
- SendClientMessage(playerid, WHITE, "Welcome to {50BB44}Western County Roleplay.");
- format(string, sizeof(string), "Account Name: {50BB44}%s",PlayerInfo[playerid][Name]);
- SendClientMessage(playerid, WHITE, string);
- if(PlayerInfo[playerid][AdminLevel] == 0) format (string, sizeof(string), "Administrator Level: {50BB44}None.");
- else format(string, sizeof(string), "Administrator Level: {50BB44}%s {FFFFFF}(%d)",GetAdminRank(playerid),PlayerInfo[playerid][AdminLevel]);
- SendClientMessage(playerid, WHITE, string);
- format(string, sizeof(string), "Level: {50BB44}%d",PlayerInfo[playerid][Level]);
- SendClientMessage(playerid, WHITE, string);
- return 1;
- }
- stock ShowProfileSettings(playerid)
- {
- new string[128];
- format(string, sizeof(string), "{FFFFFF}Change Name {50BB44}(Current: %s)\nChange Age\nChange Gender\nChange Password", PlayerInfo[playerid][Name]);
- ShowPlayerDialog(playerid, DIALOG_PROFILE, DIALOG_STYLE_LIST,"{FFFFFF}Profile",string,"Select","");
- return 1;
- }
- stock GetGender(playerid)
- {
- new astring[128];
- if(PlayerInfo[playerid][Gender] == 1)format(astring, sizeof(astring), "Male");
- else if(PlayerInfo[playerid][Gender] == 2)format(astring, sizeof(astring), "Female");
- return astring;
- }
- enum pInfo
- {
- Name[32],
- Password,
- Level,
- Registered,
- Money,
- AdminLevel,
- Age,
- Gender,
- Skin,
- RegDate,
- RegMonth,
- RegYear,
- TimesKicked,
- Banned,
- BannedBy[32],
- BanReason[128],
- TimesWarned,
- }
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- INI_String("Name", PlayerInfo[playerid][Name], 32);
- INI_Int("Password",PlayerInfo[playerid][Password]);
- INI_Int("Level",PlayerInfo[playerid][Level]);
- INI_Int("Registered",PlayerInfo[playerid][Registered]);
- INI_Int("Money",PlayerInfo[playerid][Money]);
- INI_Int("AdminLevel",PlayerInfo[playerid][AdminLevel]);
- INI_Int("Age",PlayerInfo[playerid][Age]);
- INI_Int("Gender",PlayerInfo[playerid][Gender]);
- INI_Int("Skin",PlayerInfo[playerid][Skin]);
- INI_Int("RegDate",PlayerInfo[playerid][RegDate]);
- INI_Int("RegMonth",PlayerInfo[playerid][RegMonth]);
- INI_Int("RegYear",PlayerInfo[playerid][RegYear]);
- INI_Int("TimesKicked",PlayerInfo[playerid][TimesKicked]);
- INI_Int("Banned",PlayerInfo[playerid][Banned]);
- INI_String("BannedBy",PlayerInfo[playerid][BannedBy], 32);
- INI_String("BanReason",PlayerInfo[playerid][BanReason], 128);
- INI_Int("TimesWarned",PlayerInfo[playerid][TimesWarned]);
- return 1;
- }
- stock SaveUser(playerid)
- {
- PlayerInfo[playerid][Money] = GetPlayerMoney(playerid);
- PlayerInfo[playerid][Level] = GetPlayerScore(playerid);
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"PLAYER INFORMATION");
- INI_WriteString(File,"Name",PlayerInfo[playerid][Name]);
- INI_WriteInt(File,"Password",PlayerInfo[playerid][Password]);
- INI_WriteInt(File,"Level",PlayerInfo[playerid][Level]);
- INI_WriteInt(File,"Registered",PlayerInfo[playerid][Registered]);
- INI_WriteInt(File,"Money",PlayerInfo[playerid][Money]);
- INI_WriteInt(File,"AdminLevel",PlayerInfo[playerid][AdminLevel]);
- INI_WriteInt(File,"Age",PlayerInfo[playerid][Age]);
- INI_WriteInt(File,"Gender",PlayerInfo[playerid][Gender]);
- INI_WriteInt(File,"Skin",PlayerInfo[playerid][Skin]);
- INI_WriteInt(File,"RegDate",PlayerInfo[playerid][RegDate]);
- INI_WriteInt(File,"RegMonth",PlayerInfo[playerid][RegMonth]);
- INI_WriteInt(File,"RegYear",PlayerInfo[playerid][RegYear]);
- INI_WriteInt(File,"TimesKicked",PlayerInfo[playerid][TimesKicked]);
- INI_WriteInt(File,"Banned",PlayerInfo[playerid][Banned]);
- INI_WriteString(File,"BannedBy",PlayerInfo[playerid][BannedBy]);
- INI_WriteString(File,"BanReason",PlayerInfo[playerid][BanReason]);
- INI_WriteInt(File,"TimesWarned",PlayerInfo[playerid][TimesWarned]);
- INI_Close(File);
- return 1;
- }
- Spawned[playerid] = 1;
- TogglePlayerSpectating(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, 0);
- SetSpawnInfo(playerid, 0, 170, -35.5528, 1420.6594, 13.2465, 98, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- SetCameraBehindPlayer(playerid);
- PlayerInfo[playerid][Money] = 3000;
- GivePlayerMoney(playerid, 5000);
- SendClientMessage(playerid, GREY, "We hope you enjoy your stay here.");
- return 1;
- }
- // END OF LOGIN AND REGISTRATION. \\
- // ADMIN COMMANDS\\
- // Admin Help
- CMD:ahelp(playerid, params[])
- {
- if(PlayerInfo[playerid][AdminLevel])
- {
- if(PlayerInfo[playerid][AdminLevel] >= 1)
- {
- SendClientMessage(playerid, GREY, "{0080FF}|_____________________ Trial Administrator _____________________|");
- SendClientMessage(playerid, WHITE, "/a /asay /togadmin /changestatus /setint /setvw ");
- }
- if(PlayerInfo[playerid][AdminLevel] >= 2)
- {
- SendClientMessage(playerid, GREY, "{0080FF}|_____________________ Administrator _____________________|");
- SendClientMessage(playerid, WHITE, "/kick /ban");
- }
- if(PlayerInfo[playerid][AdminLevel] >= 3)
- {
- SendClientMessage(playerid, GREY, "{0080FF}|_____________________ Senior Administrator _____________________|");
- SendClientMessage(playerid, WHITE, "/goto /get");
- }
- if(PlayerInfo[playerid][AdminLevel] >= 4)
- {
- SendClientMessage(playerid, GREY, "{0080FF}|_____________________ Management _____________________|");
- SendClientMessage(playerid, WHITE, "/freeze /unfreeze");
- }
- if(PlayerInfo[playerid][AdminLevel] == 5)
- {
- SendClientMessage(playerid, GREY, "{0080FF}|_____________________ Server Owner _____________________|");
- SendClientMessage(playerid, WHITE, "/makeadmin /makehelper");
- }
- }
- else return NotAdmin(playerid);
- return 1;
- }
- //
- CMD:a(playerid, params[])
- {
- if(PlayerInfo[playerid][AdminLevel])
- {
- if(AdminChat[playerid] == 1)
- {
- new msg[128], string[168];
- if(sscanf(params, "s[128]", msg)) return SendClientMessage(playerid, GREY, "Usage: /a [message]");
- {
- format(string,sizeof(string), "* %s %s: %s", GetAdminRank(playerid), RemoveUnderScore(playerid), msg);
- SendAdminMessage(BLUE, string);
- }
- }
- else return SendClientMessage(playerid, GREY, "Please enable your Admin Chat by /togadmin.");
- }
- else return NotAdmin(playerid);
- return 1;
- }
- //--
- CMD:asay(playerid, params[])
- {
- if(PlayerInfo[playerid][AdminLevel])
- {
- new string[128];
- if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, GREY, "Usage: /asay [text]");
- format(string, sizeof(string), "{800000}* Admin %s: %s *", RemoveUnderScore(playerid), params);
- SendClientMessageToAll(GREY, string);
- }
- else return NotAdmin(playerid);
- return 1;
- }
- //Toggle Admin
- CMD:togadmin(playerid, params[])
- {
- if(PlayerInfo[playerid][AdminLevel])
- {
- if(AdminChat[playerid])
- {
- AdminChat[playerid] = 0;
- SendClientMessage(playerid, GREY, "You have {C43C3C}Disabled {888888}the Admin Chat.");
- }
- else
- {
- AdminChat[playerid] = 1;
- SendClientMessage(playerid, GREY, "You have {008000}Enabled {888888}the Admin Chat.");
- }
- }
- else return NotAdmin(playerid);
- return 1;
- }
- //KIcking
- CMD:kick(playerid, params[])
- {
- if(PlayerInfo[playerid][AdminLevel] >= 2)
- {
- new str[128], targetid, reason[128];
- if(sscanf(params,"us[128]", targetid, reason)) return SendClientMessage(playerid, GREY, "Usage: /kick [player targetid or name] [reason]");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, GREY, NotConnected);
- if(PlayerInfo[targetid][AdminLevel] > PlayerInfo[playerid][AdminLevel]) return SendClientMessage(playerid, GREY, "The person you are trying to kick has Higher Admin Level than you.");
- format(str, sizeof(str), "Administrator %s has kicked %s. [Reason: %s]", RemoveUnderScore(playerid), RemoveUnderScore(targetid), reason);
- SendClientMessageToAll(GREY, str);
- PlayerInfo[targetid][TimesKicked] ++;
- KickPlayer(targetid);
- }
- else return NotAdmin(playerid);
- return 1;
- }
- // Banning
- CMD:ban(playerid, params[])
- {
- if(PlayerInfo[playerid][AdminLevel] >= 2)
- {
- new str[128], targetid, reason[128];
- if(sscanf(params,"us[128]", targetid, reason))return SendClientMessage(playerid, GREY, "Usage: /ban [player targetid or name] [reason]");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, GREY, NotConnected);
- if(PlayerInfo[targetid][AdminLevel] > PlayerInfo[playerid][AdminLevel]) return SendClientMessage(playerid, GREY, "The person you are trying to Ban has Higher Admin Level than you.");
- format(str, sizeof(str), "Administrator %s has Banned %s. [Reason: %s]", RemoveUnderScore(playerid), RemoveUnderScore(targetid), reason);
- SendClientMessageToAll(GREY, str);
- format(str, sizeof(str), "You have Banned %s's IP Address. [Reason: %s]", RemoveUnderScore(targetid), reason);
- SendClientMessage(playerid, GREY, str);
- PlayerInfo[targetid][Banned] = 1;
- format(PlayerInfo[targetid][BannedBy], 32, "%s", RemoveUnderScore(playerid));
- format(PlayerInfo[targetid][BanReason], 128, "%s", reason);
- KickPlayer(targetid);
- }
- else return NotAdmin(playerid);
- return 1;
- }
- // Goto and GetID
- CMD:goto(playerid, params[])
- {
- if(PlayerInfo[playerid][AdminLevel] >= 3)
- {
- new targetid, Float:x, Float:y, Float:z, interior, vw, string[128];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, GREY, "Usage: /goto [player targetid or name]");
- {
- if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, GREY, NotConnected);
- GetPlayerPos(targetid, x, y, z);
- interior = GetPlayerInterior(targetid);
- vw = GetPlayerVirtualWorld(targetid);
- format(string, sizeof(string), "You have teleported to %s's position.", RemoveUnderScore(targetid));
- SendClientMessage(playerid, LIBLUE, string);
- if(IsPlayerInAnyVehicle(playerid))
- {
- SetVehiclePos(GetPlayerVehicleID(playerid), x+4, y, z);
- }
- else
- {
- SetPlayerPos(playerid, x+4, y, z);
- SetPlayerInterior(playerid, interior);
- SetPlayerVirtualWorld(playerid, vw);
- }
- }
- }
- else return NotAdmin(playerid);
- return 1;
- }
- CMD:get(playerid, params[])
- {
- if(PlayerInfo[playerid][AdminLevel] >= 3)
- {
- new targetid, Float:x, Float:y, Float:z, interior, vw, string[128];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, GREY, "Usage: /get [player targetid or name]");
- {
- if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, GREY, NotConnected);
- GetPlayerPos(playerid, x, y, z);
- interior = GetPlayerInterior(playerid);
- vw = GetPlayerVirtualWorld(playerid);
- format(string, sizeof(string), "You have teleported %s to your position.", RemoveUnderScore(targetid));
- SendClientMessage(playerid, LIBLUE, string);
- format(string, sizeof(string), "Admin %s has teleported you to their position.", RemoveUnderScore(playerid));
- SendClientMessage(targetid, LIBLUE, string);
- if(IsPlayerInAnyVehicle(targetid))
- {
- SetVehiclePos(GetPlayerVehicleID(targetid), x+4, y, z);
- }
- else
- {
- SetPlayerPos(targetid, x+4, y, z);
- SetPlayerInterior(targetid, interior);
- SetPlayerVirtualWorld(targetid, vw);
- }
- }
- }
- else return NotAdmin(playerid);
- return 1;
- }
- // Warnings
- CMD:warn(playerid, params[])
- {
- if(PlayerInfo[playerid][AdminLevel] >= 1)
- {
- new targetid, warn[128], string[256];
- if(sscanf(params, "us[128]", targetid, warn)) return SendClientMessage(playerid, GREY, "Usage: /warn [player targetid or name] [reason]");
- {
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, GREY, NotConnected);
- format(string, sizeof(string), "{FF0000}* WARNING * from Admin %s. [Reason: %s]", RemoveUnderScore(playerid), warn);
- SendClientMessage(targetid, WHITE, string);
- format(string, sizeof(string), "{FF0000}You have warned %s for %s.", RemoveUnderScore(targetid), warn);
- SendClientMessage(playerid, WHITE, string);
- PlayerInfo[playerid][TimesWarned] ++;
- }
- }
- else return NotAdmin(playerid);
- return 1;
- }
- // Commands making people.
- CMD:makeadmin(playerid, params[])
- {
- if(PlayerInfo[playerid][AdminLevel] == 5)
- {
- new targetid, level, string[128];
- if(sscanf(params, "ud", targetid, level)) return SendClientMessage(playerid, GREY, "Usage: /makeadmin [player targetid or name] [level]");
- {
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, GREY, NotConnected);
- PlayerInfo[targetid][AdminLevel] = level;
- format(string, sizeof(string), "Administrator %s has set your Admin Level to %s (Level %d).",GetAdminRank(targetid),RemoveUnderScore(playerid), level);
- SendClientMessage(targetid, WHITE, string);
- format(string, sizeof(string), "You have set %s's Admin Level to %d.", RemoveUnderScore(targetid), level);
- SendClientMessage(playerid, WHITE, string);
- }
- }
- else return NotAdmin(playerid);
- return 1;
- }
- CMD:makehelper(playerid, params[])
- {
- if(PlayerInfo[playerid][AdminLevel] == 5)
- {
- new targetid, string[128];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, GREY, "Usage: /makeadmin [player targetid or name]");
- {
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, GREY, NotConnected);
- PlayerInfo[targetid][Helper] = 1;
- format(string, sizeof(string), "Administrator %s has set your Helper Level to 1.",GetAdminRank(targetid),RemoveUnderScore(playerid));
- SendClientMessage(targetid, WHITE, string);
- format(string, sizeof(string), "You have set %s's Helper Level to 1.", RemoveUnderScore(targetid));
- SendClientMessage(playerid, WHITE, string);
- }
- }
- else return NotAdmin(playerid);
- return 1;
- }
- //------//
- // Freeze Them!
- CMD:freeze(playerid, params[])
- {
- if(PlayerInfo[playerid][AdminLevel] >=4)
- {
- new id, string[128];
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, GREY, "Usage: /freeze [player id or name]");
- {
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, GREY, NotConnected);
- TogglePlayerControllable(id, 0);
- format(string, sizeof(string), "Administrator %s has Freezed you.", RemoveUnderScore(playerid));
- SendClientMessage(id, LIBLUE, string);
- format(string, sizeof(string), "You have frozen %s(ID: %d)", RemoveUnderScore(id), id);
- SendClientMessage(playerid, LIBLUE, string);
- }
- }
- else return NotAdmin(playerid);
- return 1;
- }
- // Un Freeze them.
- CMD:unfreeze(playerid, params[])
- {
- if(PlayerInfo[playerid][AdminLevel] >=4)
- {
- new id, string[128];
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, GREY, "Usage: /unfreeze [player id or name]");
- {
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, GREY, NotConnected);
- TogglePlayerControllable(id, 1);
- format(string, sizeof(string), "Administrator %s has Unfreezed you.", RemoveUnderScore(playerid));
- SendClientMessage(id, LIBLUE, string);
- format(string, sizeof(string), "You have unfrozen %s(ID: %d)", RemoveUnderScore(id), id);
- SendClientMessage(playerid, LIBLUE, string);
- }
- }
- else return NotAdmin(playerid);
- return 1;
- }
- // ###-- END OF ADMIN COMMANDS --###\\
- // Player Commands! WOo Woo!
- //Helping.
- CMD:help(playerid, params[])
- {
- if(Spawned[playerid])
- {
- if(sscanf(params, "s[128]", params))
- {
- SendClientMessage(playerid, GREY, "{0080FF} Please do either /general or /helper.");
- SendClientMessage(playerid, GREY, "{0080FF}Usage: {FFFFFF}/help [option]");
- SendClientMessage(playerid, GREY, "| general | helper |");
- }
- else
- {
- if(!strcmp(params, "general", true))
- {
- SendClientMessage(playerid, GREY, "GENERAL: /settings /admins /helpme /me /do /stats");
- }
- if(!strcmp(params, "helper", true))
- {
- SendClientMessage(playerid, GREY, "HELPER: /helpme /hpm");
- }
- }
- }
- else return NotLogged(playerid);
- return 1;
- }
- //Online Admins
- CMD:admins(playerid, params[])
- {
- new str[128];
- SendClientMessage(playerid, WHITE, "Online Admins.");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && PlayerInfo[i][AdminLevel] >= 1)
- {
- if(aStatus[i] == 1)
- {
- format(str, sizeof(str), "%s: %s ({40C040}Administrating)",GetAdminRank(i), RemoveUnderScore(i),i);
- }
- else if(aStatus[i] == 2)
- {
- format(str, sizeof(str), "%s: %s ({D52B2B}Roleplaying)",GetAdminRank(i), RemoveUnderScore(i),i);
- }
- else if(aStatus[i] == 3)
- {
- format(str, sizeof(str), "%s: %s ({EA9515}Off Duty)",GetAdminRank(i), RemoveUnderScore(i), i);
- }
- SendClientMessage(playerid, WHITE, str);
- }
- }
- SendClientMessage(playerid, WHITE, "------------------------------------------------");
- return 1;
- }
- CMD:settings(playerid, params[])
- {
- if(Spawned[playerid])
- {
- ShowProfileSettings(playerid);
- }
- else return NotLogged(playerid);
- return 1;
- }
- //---------------------------------------------------------------------
- // Get help from helpers
- MD:helpme(playerid, params[])
- {
- new string[128];
- if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, GREY, "Usage: /helpme [Message - What you need help with?]");
- format(string, sizeof(string), "[HELP] Player %s (ID: %d): %s",RemoveUnderScore(playerid), playerid, params);
- SendHelperMessage(LIBLUE, string);
- SendClientMessage(playerid, LIBLUE, "Your /helpme has been posted to online Helpers..");
- return 1;
- }
- CMD:me(playerid, params[])
- {
- new string[128];
- if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, GREY, "Usage: /me [action]");
- format(string, sizeof(string), "%s %s",RemoveUnderScore(playerid), params);
- CloseMessage(playerid, LIBLUE, string);
- return 1;
- }
- CMD:do(playerid, params[])
- {
- new string[128];
- if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, GREY, "Usage: /do [action]");
- format(string, sizeof(string), "%s ((%s))",params, RemoveUnderScore(playerid));
- CloseMessage(playerid, LIBLUE, string);
- return 1;
- }
- CMD:stats(playerid, params[])
- {
- new string[512];
- SendClientMessage(playerid, BLUE, "|_____[STATS]_____|");
- // PLAYER NAME
- format(string, sizeof(string), "Account Name: {50BB44}%s",PlayerInfo[playerid][Name]);
- SendClientMessage(playerid, WHITE, string);
- // GENDER
- if(PlayerInfo[playerid][Gender] == 1) format(string, sizeof(string), "Gender: {50BB44}Male");
- else if(PlayerInfo[playerid][Gender] == 2) format(string, sizeof(string), "Gender: {50BB44}Female");
- SendClientMessage(playerid, WHITE, string);
- // ADMIN LEVEL
- if(PlayerInfo[playerid][AdminLevel] == 0) format (string, sizeof(string), "Administrator Level: {50BB44}None.");
- else format(string, sizeof(string), "Administrator Level: {50BB44}%s {FFFFFF}(%d)",GetAdminRank(playerid),PlayerInfo[playerid][AdminLevel]);
- SendClientMessage(playerid, WHITE, string);
- // LEVEL
- format(string, sizeof(string), "Level: {50BB44}%d",PlayerInfo[playerid][Level]);
- SendClientMessage(playerid, WHITE, string);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SetPlayerColor(playerid, WHITE);
- SetTimerEx("InterPol", 2000, 0, "i", playerid);
- RemoveBuildings(playerid);
- aStatus[playerid] = 1; // Administrating
- if(IsValidName(playerid))
- {
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- if(!PlayerInfo[playerid][Banned])
- {
- ShowLoginDialog(playerid);
- }
- else if(PlayerInfo[playerid][Banned])
- {
- new string[128];
- SendClientMessage(playerid, GREY, "You are banned from Western County Roleplay. Make a Ban Appeal On Forums, if you wish to be Unbanned.");
- format(string, sizeof(string), "Banned By: {50BB44}%s", PlayerInfo[playerid][BannedBy]);
- SendClientMessage(playerid, GREY, string);
- format(string, sizeof(string), "Ban Reason: {50BB44}%s", PlayerInfo[playerid][BanReason]);
- SendClientMessage(playerid, GREY, string);
- KickPlayer(playerid);
- }
- }
- else
- {
- ShowRegisterDialog(playerid);
- }
- }
- else
- {
- SendClientMessage(playerid, RED, "You have been Kicked for using Incorrect Name Format.Use Firstname_Lastname.");
- KickPlayer(playerid);
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(PlayerInfo[playerid][Registered])
- {
- if(Spawned[playerid])
- {
- SaveUser(playerid);
- }
- }
- new string[128];
- switch(reason)
- {
- case 0: format(string,sizeof string,"%s left the server. (Lost Connection)", RemoveUnderScore(playerid));
- case 1: format(string,sizeof string,"%s left the server.", RemoveUnderScore(playerid));
- case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)", RemoveUnderScore(playerid));
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch( dialogid )
- {
- case DIALOG_REGISTER:
- {
- if(!response)
- {
- SendClientMessage(playerid, GREY,"You cannot proceed without Registeration.");
- ShowRegisterDialog(playerid);
- }
- if(response)
- {
- if(!strlen(inputtext))
- {
- ShowRegisterDialog(playerid);
- SendClientMessage(playerid, GREY,"You cannot proceed without Registeration.");
- }
- else
- {
- PlayerInfo[playerid][Password] = udb_hash(inputtext);
- //SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
- //SpawnPlayer(playerid);
- ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT,"{FFFFFF}Registeration Form","{FFFFFF}\nType in your {50BB44}Age. {FFFFFF} (( e.g '25' ))","Enter","");
- }
- }
- }
- case DIALOG_AGE:
- {
- if(!response)
- {
- SendClientMessage(playerid, GREY,"Please enter your {50BB44}Age.");
- ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT,"{FFFFFF}Registeration Form","{FFFFFF}\nType in your {50BB44}Age. {FFFFFF} (( e.g '25' ))","Enter","");
- }
- else if(response)
- {
- PlayerInfo[playerid][Age] = strval(inputtext);
- ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_INPUT,"{FFFFFF}Registeration Form","{FFFFFF}\nPlease Enter your {50BB44}Gender. {FFFFFF} (( 'Male' or 'Female' ))","Enter","");
- }
- }
- case DIALOG_GENDER:
- {
- if(!response)
- {
- SendClientMessage(playerid, GREY,"Please select your {50BB44}Gender.");
- ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_INPUT,"{FFFFFF}Registeration Form","{FFFFFF}\nPlease Enter your {50BB44}Gender. {FFFFFF} (( 'Male' or 'Female' ))","Enter","");
- }
- else if(response)
- {
- NewStats(playerid);
- if(!strlen(inputtext))
- {
- ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_INPUT,"{FFFFFF}Registeration Form","{FFFFFF}\nPlease Enter your {50BB44}Gender. {FFFFFF} (( 'Male' or 'Female' ))","Enter","");
- SendClientMessage(playerid, GREY,"Please select your {50BB44}Gender.");
- }
- if(strcmp(inputtext, "Male", true) == 0)
- {
- PlayerInfo[playerid][Gender] = 1;
- SendCitizenship(playerid);
- }
- else if(strcmp(inputtext, "Female", true) == 0)
- {
- PlayerInfo[playerid][Gender] = 2;
- SendCitizenship(playerid);
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_INPUT,"{FFFFFF}Registeration Form","{FFFFFF}\nPlease Enter your {50BB44}Gender. {FFFFFF} (( 'Male' or 'Female' ))","Enter","");
- }
- }
- }
- case DIALOG_LOGIN:
- {
- if(!response)
- {
- ShowLoginDialog(playerid);
- SendClientMessage(playerid, GREY,"You need to Login in order to play.");
- }
- if(response)
- {
- if(udb_hash(inputtext) == PlayerInfo[playerid][Password])
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- GivePlayerMoney(playerid, PlayerInfo[playerid][Money]);
- ShowCharacterDialog(playerid);
- }
- else
- {
- ShowLoginDialog(playerid);
- SendClientMessage(playerid, GREY, "Incorrect Password");
- LoginAttempt[playerid] ++;
- if(LoginAttempt[playerid] == 2)
- {
- LoginAttempt[playerid] = 0;
- KickPlayer(playerid);
- }
- }
- }
- }
- case DIALOG_CHARSELECT:
- {
- if(!response)
- {
- ShowCharacterDialog(playerid);
- SendClientMessage(playerid, GREY,"Please Select your Character in order to spawn, or click 'Profile Settings' for the settings.");
- }
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- TogglePlayerSpectating(playerid, 0);
- if(PlayerInfo[playerid][Skin]) SetPlayerSkin(playerid, 170);
- else SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
- ShowCharacterInformation(playerid);
- HideMNT(playerid);
- }
- case 1:
- {
- ShowProfileSettings(playerid);
- }
- }
- }
- }
- case DIALOG_PROFILE:
- {
- if(!response)
- {
- SendClientMessage(playerid, GREY,"You have chosen to close the Profile Settings.");
- if(!Spawned[playerid])
- {
- ShowLoginDialog(playerid);
- }
- }
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- // TO be Done Later
- }
- case 1:
- {
- ShowPlayerDialog(playerid, DIALOG_CHANGEAGE, DIALOG_STYLE_INPUT,"{FFFFFF}New Age","{FFFFFF}Please enter your Character's new age.","Enter","");
- }
- case 2:
- {
- ShowPlayerDialog(playerid, DIALOG_CHANGEGEN, DIALOG_STYLE_INPUT,"{FFFFFF}New Gender","{FFFFFF}Please enter your Character's new gender. (( 'Male' or 'Female' ))","Enter","");
- }
- case 3:
- {
- ShowPlayerDialog(playerid, DIALOG_CHANGEPASS, DIALOG_STYLE_INPUT,"{FFFFFF}New Password","{FFFFFF}Please enter your new password.","Enter","");
- }
- }
- }
- }
- case DIALOG_CHANGEAGE:
- {
- if(!response)
- {
- SendClientMessage(playerid, GREY,"You have chosen to cancel the changes.");
- }
- else
- {
- new string[128];
- PlayerInfo[playerid][Age] = strval(inputtext);
- format(string, sizeof(string), "You have set your Character's Age to {50BB44}%d.", strval(inputtext));
- ShowPlayerDialog(playerid, DIALOG_AGEMSG, DIALOG_STYLE_MSGBOX, "{FFFFFF}New Age",string,"Ok","");
- }
- }
- case DIALOG_CHANGEGEN:
- {
- if(!response)
- {
- SendClientMessage(playerid, GREY,"You have chosen to cancel the changes.");
- }
- else
- {
- if(!strlen(inputtext))
- {
- SendClientMessage(playerid, GREY,"You have chosen to cancel the changes.");
- }
- if(strcmp(inputtext, "Male", true) == 0)
- {
- PlayerInfo[playerid][Gender] = 1;
- SendClientMessage(playerid, GREY, "You have successfully changed your Gender to {50BB44}Male.");
- }
- else if(strcmp(inputtext, "Female", true) == 0)
- {
- PlayerInfo[playerid][Gender] = 2;
- SendClientMessage(playerid, GREY, "You have successfully changed your Gender to {50BB44}Female.");
- }
- }
- }
- case DIALOG_CHANGEPASS:
- {
- if(!response)
- {
- SendClientMessage(playerid, GREY,"You have chosen to cancel the changes.");
- }
- else
- {
- if(!strlen(inputtext))
- {
- SendClientMessage(playerid, GREY,"You have chosen to cancel the changes.");
- }
- else
- {
- new string[128];
- format(string, sizeof(string), "You have successfully changed your password to {50BB44}%s.", inputtext);
- SendClientMessage(playerid, GREY, string);
- PlayerInfo[playerid][Password] = udb_hash(inputtext);
- }
- }
- }
- case DIALOG_ASTATUS:
- {
- if(!response)
- {
- // Do nothing
- }
- else if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- aStatus[playerid] = 1;
- SendClientMessage(playerid, GREY,"You have Changed your Administrator Status to {58A624}Administrating.");
- }
- case 1:
- {
- aStatus[playerid] = 2;
- SendClientMessage(playerid, GREY,"You have Changed your Administrator Status to {FF0000}Roleplaying.");
- }
- case 2:
- {
- aStatus[playerid] = 3;
- SendClientMessage(playerid, GREY,"You have Changed your Administrator Status to {FF8C00}Off Duty.");
- }
- }
- }
- }
- }
- return 1;
- }
- stock LoadMainScreenTXD()
- {
- TDEditor_TD[0] = TextDrawCreate(-27.500000, -50.625000, "box");
- TextDrawLetterSize(TDEditor_TD[0], 0.000000, 18.599998);
- TextDrawTextSize(TDEditor_TD[0], 699.500000, 0.000000);
- TextDrawAlignment(TDEditor_TD[0], 1);
- TextDrawColor(TDEditor_TD[0], -1);
- TextDrawUseBox(TDEditor_TD[0], 1);
- TextDrawBoxColor(TDEditor_TD[0], 110);
- TextDrawSetShadow(TDEditor_TD[0], 0);
- TextDrawSetOutline(TDEditor_TD[0], 0);
- TextDrawBackgroundColor(TDEditor_TD[0], 255);
- TextDrawFont(TDEditor_TD[0], 1);
- TextDrawSetProportional(TDEditor_TD[0], 1);
- TextDrawSetShadow(TDEditor_TD[0], 0);
- TDEditor_TD[1] = TextDrawCreate(193.000000, 39.062500, "Western County");
- TextDrawLetterSize(TDEditor_TD[1], 0.865500, 3.332499);
- TextDrawAlignment(TDEditor_TD[1], 1);
- TextDrawColor(TDEditor_TD[1], -1);
- TextDrawSetShadow(TDEditor_TD[1], 0);
- TextDrawSetOutline(TDEditor_TD[1], 1);
- TextDrawBackgroundColor(TDEditor_TD[1], 255);
- TextDrawFont(TDEditor_TD[1], 3);
- TextDrawSetProportional(TDEditor_TD[1], 1);
- TextDrawSetShadow(TDEditor_TD[1], 0);
- TDEditor_TD[2] = TextDrawCreate(265.500000, 70.125000, "Roleplay");
- TextDrawLetterSize(TDEditor_TD[2], 0.737999, 2.396251);
- TextDrawAlignment(TDEditor_TD[2], 1);
- TextDrawColor(TDEditor_TD[2], -1);
- TextDrawSetShadow(TDEditor_TD[2], 0);
- TextDrawSetOutline(TDEditor_TD[2], 1);
- TextDrawBackgroundColor(TDEditor_TD[2], 255);
- TextDrawFont(TDEditor_TD[2], 0);
- TextDrawSetProportional(TDEditor_TD[2], 1);
- TextDrawSetShadow(TDEditor_TD[2], 0);
- TDEditor_TD[3] = TextDrawCreate(452.000000, 16.312500, "");
- TextDrawLetterSize(TDEditor_TD[3], 0.000000, 0.000000);
- TextDrawTextSize(TDEditor_TD[3], 60.000000, 72.062500);
- TextDrawAlignment(TDEditor_TD[3], 1);
- TextDrawColor(TDEditor_TD[3], -1);
- TextDrawSetShadow(TDEditor_TD[3], 0);
- TextDrawSetOutline(TDEditor_TD[3], 0);
- TextDrawBackgroundColor(TDEditor_TD[3], 0);
- TextDrawFont(TDEditor_TD[3], 5);
- TextDrawSetProportional(TDEditor_TD[3], 1);
- TextDrawSetShadow(TDEditor_TD[3], 0);
- TextDrawSetPreviewModel(TDEditor_TD[3], 170);
- TextDrawSetPreviewRot(TDEditor_TD[3], 0.000000, 0.000000, -30.000000, 1.000000);
- TDEditor_TD[4] = TextDrawCreate(419.500000, 18.062500, "");
- TextDrawLetterSize(TDEditor_TD[4], 0.000000, 0.000000);
- TextDrawTextSize(TDEditor_TD[4], 60.000000, 72.062500);
- TextDrawAlignment(TDEditor_TD[4], 1);
- TextDrawColor(TDEditor_TD[4], -1);
- TextDrawSetShadow(TDEditor_TD[4], 0);
- TextDrawSetOutline(TDEditor_TD[4], 0);
- TextDrawBackgroundColor(TDEditor_TD[4], 0);
- TextDrawFont(TDEditor_TD[4], 5);
- TextDrawSetProportional(TDEditor_TD[4], 1);
- TextDrawSetShadow(TDEditor_TD[4], 0);
- TextDrawSetPreviewModel(TDEditor_TD[4], 161);
- TextDrawSetPreviewRot(TDEditor_TD[4], 0.000000, 0.000000, 30.000000, 1.000000);
- TDEditor_TD[5] = TextDrawCreate(-56.000000, 312.937500, "box");
- TextDrawLetterSize(TDEditor_TD[5], 0.000000, 18.599998);
- TextDrawTextSize(TDEditor_TD[5], 671.000000, 0.000000);
- TextDrawAlignment(TDEditor_TD[5], 1);
- TextDrawColor(TDEditor_TD[5], -1);
- TextDrawUseBox(TDEditor_TD[5], 1);
- TextDrawBoxColor(TDEditor_TD[5], 110);
- TextDrawSetShadow(TDEditor_TD[5], 0);
- TextDrawSetOutline(TDEditor_TD[5], 0);
- TextDrawBackgroundColor(TDEditor_TD[5], 255);
- TextDrawFont(TDEditor_TD[5], 1);
- TextDrawSetProportional(TDEditor_TD[5], 1);
- TextDrawSetShadow(TDEditor_TD[5], 0);
- TDEditor_TD[6] = TextDrawCreate(0.500000, 123.937500, "box");
- TextDrawLetterSize(TDEditor_TD[6], 0.000000, -0.649999);
- TextDrawTextSize(TDEditor_TD[6], 697.500000, 0.000000);
- TextDrawAlignment(TDEditor_TD[6], 1);
- TextDrawColor(TDEditor_TD[6], -1);
- TextDrawUseBox(TDEditor_TD[6], 1);
- TextDrawBoxColor(TDEditor_TD[6], 110);
- TextDrawSetShadow(TDEditor_TD[6], 0);
- TextDrawSetOutline(TDEditor_TD[6], 0);
- TextDrawBackgroundColor(TDEditor_TD[6], 255);
- TextDrawFont(TDEditor_TD[6], 1);
- TextDrawSetProportional(TDEditor_TD[6], 1);
- TextDrawSetShadow(TDEditor_TD[6], 0);
- TDEditor_TD[7] = TextDrawCreate(-18.000000, 311.625000, "box");
- TextDrawLetterSize(TDEditor_TD[7], 0.000000, -0.649999);
- TextDrawTextSize(TDEditor_TD[7], 679.000000, 0.000000);
- TextDrawAlignment(TDEditor_TD[7], 1);
- TextDrawColor(TDEditor_TD[7], -1);
- TextDrawUseBox(TDEditor_TD[7], 1);
- TextDrawBoxColor(TDEditor_TD[7], 110);
- TextDrawSetShadow(TDEditor_TD[7], 0);
- TextDrawSetOutline(TDEditor_TD[7], 0);
- TextDrawBackgroundColor(TDEditor_TD[7], 255);
- TextDrawFont(TDEditor_TD[7], 1);
- TextDrawSetProportional(TDEditor_TD[7], 1);
- TextDrawSetShadow(TDEditor_TD[7], 0);
- TDEditor_TD[8] = TextDrawCreate(8.000000, 427.562500, "http://westerncountyrp.net16.net/index.php");
- TextDrawLetterSize(TDEditor_TD[8], 0.287499, 1.315625);
- TextDrawAlignment(TDEditor_TD[8], 1);
- TextDrawColor(TDEditor_TD[8], -1);
- TextDrawSetShadow(TDEditor_TD[8], 0);
- TextDrawSetOutline(TDEditor_TD[8], 1);
- TextDrawBackgroundColor(TDEditor_TD[8], 255);
- TextDrawFont(TDEditor_TD[8], 1);
- TextDrawSetProportional(TDEditor_TD[8], 1);
- TextDrawSetShadow(TDEditor_TD[8], 0);
- return 1;
- }
- //---------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement