Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- //#define FILTERSCRIPT
- #include <a_samp>
- #include <core>
- #include <float>
- #include <time>
- #include <file>
- #include <streamer>
- #include <morphinc>
- #include <a_npc>
- #include <Dini>
- #include <ipcheck>
- #include <sscanf>
- #include <YSI\y_ini>
- #include <YSI\y_commands>
- #include <YSI\y_groups>
- //KeyStateChange defines
- #define RELEASED(%0) \
- (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
- //Login & Register defines
- #define DIALOG_REGISTER 1
- #define DIALOG_LOGIN 2
- #define DIALOG_SUCCESS_1 3
- #define DIALOG_SUCCESS_2 4
- #define PATH "/Users/%s.ini"
- //Admin defines
- #define MAX_ADMIN_LEVELS (4)
- //Login & Register color defines
- #define COL_WHITE "{FFFFFF}"
- #define COL_RED "{F81414}"
- #define COL_GREEN "{00FF22}"
- #define COL_LIGHTBLUE "{00CED1}"
- // System Defined Colors
- #define COLOR_ACTIVEBORDER 0xB4B4B4FF
- #define COLOR_ACTIVECAPTION 0x99B4D1FF
- #define COLOR_ACTIVECAPTIONTEXT 0x000000FF
- #define COLOR_ALICEBLUE 0xF0F8FFFF
- #define COLOR_ANTIQUEWHITE 0xFAEBD7FF
- #define COLOR_APPWORKSPACE 0xABABABFF
- #define COLOR_AQUA 0x00FFFFFF
- #define COLOR_AQUAMARINE 0x7FFFD4FF
- #define COLOR_AZURE 0xF0FFFFFF
- #define COLOR_BEIGE 0xF5F5DCFF
- #define COLOR_BISQUE 0xFFE4C4FF
- #define COLOR_BLACK 0x000000FF
- #define COLOR_BLANCHEDALMOND 0xFFEBCDFF
- #define COLOR_BLUE 0x0000FFFF
- #define COLOR_BLUEVIOLET 0x8A2BE2FF
- #define COLOR_BROWN 0xA52A2AFF
- #define COLOR_BURLYWOOD 0xDEB887FF
- #define COLOR_BUTTONFACE 0xF0F0F0FF
- #define COLOR_BUTTONHIGHLIGHT 0xFFFFFFFF
- #define COLOR_BUTTONSHADOW 0xA0A0A0FF
- #define COLOR_CADETBLUE 0x5F9EA0FF
- #define COLOR_CHARTREUSE 0x7FFF00FF
- #define COLOR_CHOCOLATE 0xD2691EFF
- #define COLOR_CONTROL 0xF0F0F0FF
- #define COLOR_CONTROLDARK 0xA0A0A0FF
- #define COLOR_CONTROLDARKDARK 0x696969FF
- #define COLOR_CONTROLLIGHT 0xE3E3E3FF
- #define COLOR_CONTROLLIGHTLIGHT 0xFFFFFFFF
- #define COLOR_CONTROLTEXT 0x000000FF
- #define COLOR_CORAL 0xFF7F50FF
- #define COLOR_CORNFLOWERBLUE 0x6495EDFF
- #define COLOR_CORNSILK 0xFFF8DCFF
- #define COLOR_CRIMSON 0xDC143CFF
- #define COLOR_CYAN 0x00FFFFFF
- #define COLOR_DARKBLUE 0x00008BFF
- #define COLOR_DARKCYAN 0x008B8BFF
- #define COLOR_DARKGOLDENROD 0xB8860BFF
- #define COLOR_DARKGRAY 0xA9A9A9FF
- #define COLOR_DARKGREEN 0x006400FF
- #define COLOR_DARKKHAKI 0xBDB76BFF
- #define COLOR_DARKMAGENTA 0x8B008BFF
- #define COLOR_DARKOLIVEGREEN 0x556B2FFF
- #define COLOR_DARKORANGE 0xFF8C00FF
- #define COLOR_DARKORCHID 0x9932CCFF
- #define COLOR_DARKRED 0x8B0000FF
- #define COLOR_DARKSALMON 0xE9967AFF
- #define COLOR_DARKSEAGREEN 0x8FBC8BFF
- #define COLOR_DARKSLATEBLUE 0x483D8BFF
- #define COLOR_DARKSLATEGRAY 0x2F4F4FFF
- #define COLOR_DARKTURQUOISE 0x00CED1FF
- #define COLOR_DARKVIOLET 0x9400D3FF
- #define COLOR_DEEPPINK 0xFF1493FF
- #define COLOR_DEEPSKYBLUE 0x00BFFFFF
- #define COLOR_DESKTOP 0x000000FF
- #define COLOR_DIMGRAY 0x696969FF
- #define COLOR_DODGERBLUE 0x1E90FFFF
- #define COLOR_FIREBRICK 0xB22222FF
- #define COLOR_FLORALWHITE 0xFFFAF0FF
- #define COLOR_FORESTGREEN 0x228B22FF
- #define COLOR_FUCHSIA 0xFF00FFFF
- #define COLOR_GAINSBORO 0xDCDCDCFF
- #define COLOR_GHOSTWHITE 0xF8F8FFFF
- #define COLOR_GOLD 0xFFD700FF
- #define COLOR_GOLDENROD 0xDAA520FF
- #define COLOR_GRADIENTACTIVECAPTION 0xB9D1EAFF
- #define COLOR_GRADIENTINACTIVECAPTION 0xD7E4F2FF
- #define COLOR_GRAY 0x808080FF
- #define COLOR_GRAYTEXT 0x808080FF
- #define COLOR_GREEN 0x008000FF
- #define COLOR_GREENYELLOW 0xADFF2FFF
- #define COLOR_HIGHLIGHT 0x3399FFFF
- #define COLOR_HIGHLIGHTTEXT 0xFFFFFFFF
- #define COLOR_HONEYDEW 0xF0FFF0FF
- #define COLOR_HOTPINK 0xFF69B4FF
- #define COLOR_HOTTRACK 0x0066CCFF
- #define COLOR_INACTIVEBORDER 0xF4F7FCFF
- #define COLOR_INACTIVECAPTION 0xBFCDDBFF
- #define COLOR_INACTIVECAPTIONTEXT 0x434E54FF
- #define COLOR_INDIANRED 0xCD5C5CFF
- #define COLOR_INDIGO 0x4B0082FF
- #define COLOR_INFO 0xFFFFE1FF
- #define COLOR_INFOTEXT 0x000000FF
- #define COLOR_IVORY 0xFFFFF0FF
- #define COLOR_KHAKI 0xF0E68CFF
- #define COLOR_LAVENDER 0xE6E6FAFF
- #define COLOR_LAVENDERBLUSH 0xFFF0F5FF
- #define COLOR_LAWNGREEN 0x7CFC00FF
- #define COLOR_LEMONCHIFFON 0xFFFACDFF
- #define COLOR_LIGHTBLUE 0xADD8E6FF
- #define COLOR_LIGHTCORAL 0xF08080FF
- #define COLOR_LIGHTCYAN 0xE0FFFFFF
- #define COLOR_LIGHTGOLDENRODYELLOW 0xFAFAD2FF
- #define COLOR_LIGHTGRAY 0xD3D3D3FF
- #define COLOR_LIGHTGREEN 0x90EE90FF
- #define COLOR_LIGHTPINK 0xFFB6C1FF
- #define COLOR_LIGHTSALMON 0xFFA07AFF
- #define COLOR_LIGHTSEAGREEN 0x20B2AAFF
- #define COLOR_LIGHTSKYBLUE 0x87CEFAFF
- #define COLOR_LIGHTSLATEGRAY 0x778899FF
- #define COLOR_LIGHTSTEELBLUE 0xB0C4DEFF
- #define COLOR_LIGHTYELLOW 0xFFFFE0FF
- #define COLOR_LIME 0x00FF00FF
- #define COLOR_LIMEGREEN 0x32CD32FF
- #define COLOR_LINEN 0xFAF0E6FF
- #define COLOR_MAGENTA 0xFF00FFFF
- #define COLOR_MAROON 0x800000FF
- #define COLOR_MEDIUMAQUAMARINE 0x66CDAAFF
- #define COLOR_MEDIUMBLUE 0x0000CDFF
- #define COLOR_MEDIUMORCHID 0xBA55D3FF
- #define COLOR_MEDIUMPURPLE 0x9370DBFF
- #define COLOR_MEDIUMSEAGREEN 0x3CB371FF
- #define COLOR_MEDIUMSLATEBLUE 0x7B68EEFF
- #define COLOR_MEDIUMSPRINGGREEN 0x00FA9AFF
- #define COLOR_MEDIUMTURQUOISE 0x48D1CCFF
- #define COLOR_MEDIUMVIOLETRED 0xC71585FF
- #define COLOR_MENU 0xF0F0F0FF
- #define COLOR_MENUBAR 0xF0F0F0FF
- #define COLOR_MENUHIGHLIGHT 0x3399FFFF
- #define COLOR_MENUTEXT 0x000000FF
- #define COLOR_MIDNIGHTBLUE 0x191970FF
- #define COLOR_MINTCREAM 0xF5FFFAFF
- #define COLOR_MISTYROSE 0xFFE4E1FF
- #define COLOR_MOCCASIN 0xFFE4B5FF
- #define COLOR_NAVAJOWHITE 0xFFDEADFF
- #define COLOR_NAVY 0x000080FF
- #define COLOR_OLDLACE 0xFDF5E6FF
- #define COLOR_OLIVE 0x808000FF
- #define COLOR_OLIVEDRAB 0x6B8E23FF
- #define COLOR_ORANGE 0xFFA500FF
- #define COLOR_ORANGERED 0xFF4500FF
- #define COLOR_ORCHID 0xDA70D6FF
- #define COLOR_PALEGOLDENROD 0xEEE8AAFF
- #define COLOR_PALEGREEN 0x98FB98FF
- #define COLOR_PALETURQUOISE 0xAFEEEEFF
- #define COLOR_PALEVIOLETRED 0xDB7093FF
- #define COLOR_PAPAYAWHIP 0xFFEFD5FF
- #define COLOR_PEACHPUFF 0xFFDAB9FF
- #define COLOR_PERU 0xCD853FFF
- #define COLOR_PINK 0xFFC0CBFF
- #define COLOR_PLUM 0xDDA0DDFF
- #define COLOR_POWDERBLUE 0xB0E0E6FF
- #define COLOR_PURPLE 0x800080FF
- #define COLOR_RED 0xFF0000FF
- #define COLOR_ROSYBROWN 0xBC8F8FFF
- #define COLOR_ROYALBLUE 0x4169E1FF
- #define COLOR_SADDLEBROWN 0x8B4513FF
- #define COLOR_SALMON 0xFA8072FF
- #define COLOR_SANDYBROWN 0xF4A460FF
- #define COLOR_SCROLLBAR 0xC8C8C8FF
- #define COLOR_SEAGREEN 0x2E8B57FF
- #define COLOR_SEASHELL 0xFFF5EEFF
- #define COLOR_SIENNA 0xA0522DFF
- #define COLOR_SILVER 0xC0C0C0FF
- #define COLOR_SKYBLUE 0x87CEEBFF
- #define COLOR_SLATEBLUE 0x6A5ACDFF
- #define COLOR_SLATEGRAY 0x708090FF
- #define COLOR_SNOW 0xFFFAFAFF
- #define COLOR_SPRINGGREEN 0x00FF7FFF
- #define COLOR_STEELBLUE 0x4682B4FF
- #define COLOR_TAN 0xD2B48CFF
- #define COLOR_TEAL 0x008080FF
- #define COLOR_THISTLE 0xD8BFD8FF
- #define COLOR_TOMATO 0xFF6347FF
- #define COLOR_TRANSPARENT 0xFFFFFF00
- #define COLOR_TURQUOISE 0x40E0D0FF
- #define COLOR_VIOLET 0xEE82EEFF
- #define COLOR_WHEAT 0xF5DEB3FF
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_WHITESMOKE 0xF5F5F5FF
- #define COLOR_WINDOW 0xFFFFFFFF
- #define COLOR_WINDOWFRAME 0x646464FF
- #define COLOR_WINDOWTEXT 0x000000FF
- #define COLOR_YELLOW 0xFFFF00FF
- #define COLOR_YELLOWGREEN 0x9ACD32FF
- #define STEALTH_ORANGE 0xFF880000
- #define STEALTH_OLIVE 0x66660000
- #define STEALTH_GREEN 0x33DD1100
- #define STEALTH_PINK 0xFF22EE00
- #define STEALTH_BLUE 0x0077BB00
- new GotProposedBy[MAX_PLAYERS];
- new police;
- new ballas;
- new grove;
- new mafia;
- new Group:gAdmins[MAX_ADMIN_LEVELS];
- enum pData
- {
- AdminLevel,
- Pass,
- Cash,
- Kills,
- Deaths
- };
- new PlayerData[MAX_PLAYERS][pData];
- stock UserPath(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),PATH,playername);
- return string;
- }
- strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
- YCMD:kick(playerid, params[], help)
- {
- if (help)
- {
- return SendClientMessage(playerid, 0xFF0000AA, "Kicks another player.");
- }
- else
- {
- new
- pid,
- reason[32];
- if (sscanf(params, "uS[32]", pid, reason))
- {
- return SendClientMessage(playerid, 0xFF0000AA, "Parameters: <playerid/name> [reason]");
- }
- if (reason[0])
- {
- SendClientMessage(pid, 0xFF0000AA, "You have been kicked. Reason:");
- SendClientMessage(pid, 0xFF0000AA, reason);
- }
- else
- {
- SendClientMessage(pid, 0xFF0000AA, "You have been kicked.");
- }
- Kick(pid);
- }
- return 1;
- }
- YCMD:ban(playerid, params[], help)
- {
- if (help)
- {
- return SendClientMessage(playerid, 0xFF0000AA, "Bans another player.");
- }
- else
- {
- new
- pid,
- reason[32];
- if (sscanf(params, "uS[32]", pid, reason))
- {
- return SendClientMessage(playerid, 0xFF0000AA, "Parameters: <playerid/name> [reason]");
- }
- if (reason[0])
- {
- SendClientMessage(pid, 0xFF0000AA, "You have been banned. Reason:");
- SendClientMessage(pid, 0xFF0000AA, reason);
- }
- else
- {
- SendClientMessage(pid, 0xFF0000AA, "You have been banned.");
- }
- Ban(pid);
- }
- return 1;
- }
- YCMD:pm(playerid, params[], help)
- {
- if (help)
- {
- return SendClientMessage(playerid, 0xFF0000AA, "Sends a private message to another player.");
- }
- else
- {
- new
- pid,
- message[32];
- if (sscanf(params, "us[32]", pid, message))
- {
- return SendClientMessage(playerid, 0xFF0000AA, "Parameters: <playerid/name> <message>");
- }
- SendClientMessage(pid, 0xFF0000AA, "Incoming message:");
- SendClientMessage(pid, 0xFF0000AA, message);
- SendClientMessage(playerid, 0xFF0000AA, "Sent!");
- }
- return 1;
- }
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- INI_Int("Password",PlayerData[playerid][Pass]);
- INI_Int("Cash",PlayerData[playerid][Cash]);
- INI_Int("Admin",PlayerData[playerid][AdminLevel]);
- INI_Int("Kills",PlayerData[playerid][Kills]);
- INI_Int("Deaths",PlayerData[playerid][Deaths]);
- return 1;
- }
- stock udb_hash(buf[]) {
- new length=strlen(buf);
- new s1 = 1;
- new s2 = 0;
- new n;
- for (n=0; n<length; n++)
- {
- s1 = (s1 + buf[n]) % 65521;
- s2 = (s2 + s1) % 65521;
- }
- return (s2 << 16) + s1;
- }
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("TheDM v1.0");
- //Police forces
- police = AddPlayerClass(280,1542.6294,-1675.2057,13.5549,84.1688,0,0,0,0,0,0); // police.1
- police = AddPlayerClass(281,1542.6294,-1675.2057,13.5549,84.1688,0,0,0,0,0,0); // police.2
- police = AddPlayerClass(282,1542.6294,-1675.2057,13.5549,84.1688,0,0,0,0,0,0); // police.3
- police = AddPlayerClass(283,1542.6294,-1675.2057,13.5549,84.1688,0,0,0,0,0,0); // police.4
- police = AddPlayerClass(284,1542.6294,-1675.2057,13.5549,84.1688,0,0,0,0,0,0); // police.5
- police = AddPlayerClass(285,1542.6294,-1675.2057,13.5549,84.1688,0,0,0,0,0,0); // police.6
- police = AddPlayerClass(286,1542.6294,-1675.2057,13.5549,84.1688,0,0,0,0,0,0); // police.7
- police = AddPlayerClass(287,1542.6294,-1675.2057,13.5549,84.1688,0,0,0,0,0,0); // police.8
- police = AddPlayerClass(288,1542.6294,-1675.2057,13.5549,84.1688,0,0,0,0,0,0); // police.9
- //Ballas Gang
- ballas = AddPlayerClass(102,2008.2842,-1733.1367,13.5469,87.0397,0,0,0,0,0,0); // ballas.1
- ballas = AddPlayerClass(103,2008.2842,-1733.1367,13.5469,87.0397,0,0,0,0,0,0); // ballas.2
- ballas = AddPlayerClass(104,2008.2842,-1733.1367,13.5469,87.0397,0,0,0,0,0,0); // ballas.3
- //Grove gang
- grove = AddPlayerClass(105,2495.0957,-1682.1321,13.3388,0.9898,0,0,0,0,0,0); // grove.1
- grove = AddPlayerClass(106,2495.0957,-1682.1321,13.3388,0.9898,0,0,0,0,0,0); // grove.2
- grove = AddPlayerClass(107,2495.0957,-1682.1321,13.3388,0.9898,0,0,0,0,0,0); // grove.3
- //Russian Mafia
- mafia = AddPlayerClass(111,1110.0437,-1796.7803,16.5938,86.2630,0,0,0,0,0,0); // mafia.1
- mafia = AddPlayerClass(112,1110.0437,-1796.7803,16.5938,86.2630,0,0,0,0,0,0); // mafia.2
- mafia = AddPlayerClass(113,1110.0437,-1796.7803,16.5938,86.2630,0,0,0,0,0,0); // mafia.3
- //Vehicles
- AddStaticVehicle(411,1535.7905,-1666.9576,13.1099,0.7674,112,1); // carpos
- //-----------------------------------------------------------------------------------------------------
- new name[16];
- for (new i = 0; i != MAX_ADMIN_LEVELS; ++i)
- {
- format(name, sizeof (name), "Admin Level %d+", i + 1);
- gAdmins[i] = Group_Create(name);
- }
- // "/kick" is a level 1 admin command.
- SetAdminCommand("kick", 1);
- // "/ban" is a level 2 admin command.
- SetAdminCommand("ban", 2);
- // "/pm" is not an admin command (not required as it's the default).
- SetAdminCommand("pm", 0);
- return 1;
- }
- SetAdminCommand(command[], level)
- {
- // Get the ID of the command (required):
- new
- id = Command_GetID(command);
- if (level)
- {
- // To be used only by admins.
- // First let no normal people use it.
- Group_SetGlobalCommand(id, false);
- // Then loop through admin levels and set it true on the ones it can be
- // used by and false on the others.
- new
- cl = 0;
- while (cl != MAX_ADMIN_LEVELS)
- {
- new
- Group:group = gAdmins[cl];
- ++cl;
- if (cl == level)
- {
- // Set this level as using the command.
- Group_SetCommand(group, id, true);
- }
- else
- {
- // Set this level as not using this command.
- Group_SetCommand(group, id, false);
- }
- }
- }
- else
- {
- // To be used by everyone, so let everyone use it.
- Group_SetGlobalCommand(id, true);
- }
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- if(GetPlayerSkin(playerid) == police)
- {
- SetPlayerPos(playerid, 1542.6294,-1675.2057,13.5549);
- SetPlayerCameraPos(playerid, 1542.6294,-1675.2057,13.5549);
- SetPlayerCameraLookAt(playerid, 1542.6294,-1675.2057,13.5549);
- SetPlayerFacingAngle(playerid, 84.1688);
- GameTextForPlayer(playerid, "~b~Police Force", 2000, 4);
- GivePlayerMoney(playerid, 10000);
- }
- if(GetPlayerSkin(playerid) == ballas)
- {
- SetPlayerPos(playerid, 2008.2842,-1733.1367,13.5469);
- SetPlayerCameraPos(playerid, 2008.2842,-1733.1367,13.5469);
- SetPlayerCameraLookAt(playerid, 2008.2842,-1733.1367,13.5469);
- SetPlayerFacingAngle(playerid, 87.0397);
- GameTextForPlayer(playerid, "~p~Ballas Gang", 2000, 4);
- GivePlayerMoney(playerid, 10000);
- }
- if(GetPlayerSkin(playerid) == grove)
- {
- SetPlayerPos(playerid, 2495.0957,-1682.1321,13.3388);
- SetPlayerCameraPos(playerid, 2495.0957,-1682.1321,13.3388);
- SetPlayerCameraLookAt(playerid, 2495.0957,-1682.1321,13.3388);
- SetPlayerFacingAngle(playerid, 0.9898);
- GameTextForPlayer(playerid, "~g~Grove Gang", 2000, 4);
- GivePlayerMoney(playerid, 10000);
- }
- if(GetPlayerSkin(playerid) == mafia)
- {
- SetPlayerPos(playerid, 1110.0437,-1796.7803,16.5938);
- SetPlayerCameraPos(playerid, 1110.0437,-1796.7803,16.5938);
- SetPlayerCameraLookAt(playerid, 1110.0437,-1796.7803,16.5938);
- SetPlayerFacingAngle(playerid, 86.2630);
- GameTextForPlayer(playerid, "~r~Russian Mafia", 2000, 4);
- GivePlayerMoney(playerid, 10000);
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- //
- GotProposedBy[playerid] = 999;
- //
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Register",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
- }
- if (IsPlayerAdmin(playerid))
- {
- // Add the player to the second admin level. Default is not a member.
- Group_SetPlayer(gAdmins[2], playerid, true);
- // "false" is used to remove a player.
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
- INI_WriteInt(File,"Admin",PlayerData[playerid][AdminLevel]);
- INI_WriteInt(File,"Kills",PlayerData[playerid][Kills]);
- INI_WriteInt(File,"Deaths",PlayerData[playerid][Deaths]);
- INI_Close(File);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(GetPlayerSkin(playerid) == police)
- {
- SetPlayerPos(playerid, 1542.6294,-1675.2057,13.5549);
- SetPlayerCameraPos(playerid, 1542.6294,-1675.2057,13.5549);
- SetPlayerCameraLookAt(playerid, 1542.6294,-1675.2057,13.5549);
- SetPlayerFacingAngle(playerid, 84.1688);
- GameTextForPlayer(playerid, "~b~Police Force", 2000, 4);
- GivePlayerMoney(playerid, 10000);
- SetPlayerColor(playerid, COLOR_BLUE);
- }
- if(GetPlayerSkin(playerid) == ballas)
- {
- SetPlayerPos(playerid, 2008.2842,-1733.1367,13.5469);
- SetPlayerCameraPos(playerid, 2008.2842,-1733.1367,13.5469);
- SetPlayerCameraLookAt(playerid, 2008.2842,-1733.1367,13.5469);
- SetPlayerFacingAngle(playerid, 87.0397);
- GameTextForPlayer(playerid, "~p~Ballas Gang", 2000, 4);
- GivePlayerMoney(playerid, 10000);
- SetPlayerColor(playerid, COLOR_PURPLE);
- }
- if(GetPlayerSkin(playerid) == grove)
- {
- SetPlayerPos(playerid, 2495.0957,-1682.1321,13.3388);
- SetPlayerCameraPos(playerid, 2495.0957,-1682.1321,13.3388);
- SetPlayerCameraLookAt(playerid, 2495.0957,-1682.1321,13.3388);
- SetPlayerFacingAngle(playerid, 0.9898);
- GameTextForPlayer(playerid, "~g~Grove Gang", 2000, 4);
- GivePlayerMoney(playerid, 10000);
- SetPlayerColor(playerid, COLOR_GREEN);
- }
- if(GetPlayerSkin(playerid) == mafia)
- {
- SetPlayerPos(playerid, 1110.0437,-1796.7803,16.5938);
- SetPlayerCameraPos(playerid, 1110.0437,-1796.7803,16.5938);
- SetPlayerCameraLookAt(playerid, 1110.0437,-1796.7803,16.5938);
- SetPlayerFacingAngle(playerid, 86.2630);
- GameTextForPlayer(playerid, "~r~Russian Mafia", 2000, 4);
- GivePlayerMoney(playerid, 10000);
- SetPlayerColor(playerid, COLOR_RED);
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- PlayerData[killerid][Kills]++;
- PlayerData[playerid][Deaths]++;
- GivePlayerMoney(killerid, 2000);
- SendClientMessage(killerid, COLOR_YELLOW, "You killed a player and earned $2000.");
- GivePlayerMoney(playerid, -1000);
- SendClientMessage(playerid, COLOR_YELLOW, "You died and lost $1000.");
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- new gplayer[MAX_PLAYER_NAME];
- new sendername[MAX_PLAYER_NAME];
- new string[156];
- if(IsIp(text))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(GotProposedBy[playerid], gplayer, sizeof(gplayer));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have been kicked for attempting to advertise.");
- format(string, sizeof(string), "%s has been kicked by Anticheat for attempt of advertise.", sendername);
- SendClientMessageToAll(COLOR_RED, string);
- Kick(playerid);
- return 0;
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/help", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid, COLOR_GREEN, "___________[CMDS]__________");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "[CMD]: /admins /status /shop /kill");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "[CMD]: More coming.");
- return 1;
- }
- if (strcmp("/kill", cmdtext, true, 10) == 0)
- {
- SetPlayerHealth(playerid, 0);
- return 1;
- }
- if (strcmp("/status", cmdtext, true, 10) == 0)
- {
- new kills = PlayerData[playerid][Kills];
- new deaths = PlayerData[playerid][Deaths];
- new string[156];
- format(string, sizeof(string), "Kills: %d Deaths: %d",kills,deaths);
- SendClientMessage(playerid, COLOR_GREEN, string);
- return 1;
- }
- if (strcmp("/shop", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid, COLOR_GREEN, "_______Weapon Names_______");
- SendClientMessage(playerid, COLOR_GREEN, "M4 - 200 bullets - $8000");
- SendClientMessage(playerid, COLOR_GREEN, "MP5 - 200 bullets - $5000");
- SendClientMessage(playerid, COLOR_GREEN, "Combat shotgun - 200 bullets - $10000");
- SendClientMessage(playerid, COLOR_GREEN, "Regular shotgun - 200 bullets - $5000");
- SendClientMessage(playerid, COLOR_GREEN, "Desert eagle - 200 bullets - $8000");
- SendClientMessage(playerid, COLOR_GREEN, "TEC-9 - 500 bullets - $11000");
- SendClientMessage(playerid, COLOR_GREEN, "Sniper rifle - 100 bullets - $8000");
- SendClientMessage(playerid, COLOR_GREEN, "AK-47 - 200 bullets - $8000");
- SendClientMessage(playerid, COLOR_GREEN, "If you want to buy one of those weapons type /buy [weaponname]");
- return 1;
- }
- if (strcmp("/buy", cmdtext, true, 10) == 0)
- {
- new idx;
- idx = 184;
- new x_nr[64];
- x_nr = strtok(cmdtext, idx);
- if(!strlen(x_nr))
- {
- SendClientMessage(playerid, COLOR_LIGHTCYAN, "HINT: /buy [name]");
- SendClientMessage(playerid, COLOR_CYAN, "Available names: M4, MP5, Combat shotgun, Regular shotgun, Desert eagle, TEC-9, Sniper rifle, AK-47");
- return 1;
- }
- if(strcmp(x_nr, "M4", true) == 0)
- {
- if(GetPlayerMoney(playerid) == 8000)
- {
- GivePlayerWeapon(playerid, 31, 200);
- GivePlayerMoney(playerid, -8000);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTCYAN, "Not enough money to buy this weapon.");
- }
- }
- else if(strcmp(x_nr, "MP5", true) == 0)
- {
- if(GetPlayerMoney(playerid) == 5000)
- {
- GivePlayerWeapon(playerid, 29, 200);
- GivePlayerMoney(playerid, -5000);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTCYAN, "Not enough money to buy this weapon.");
- }
- }
- else if(strcmp(x_nr, "Combat shotgun", true) == 0)
- {
- if(GetPlayerMoney(playerid) == 10000)
- {
- GivePlayerWeapon(playerid, 27, 200);
- GivePlayerMoney(playerid, -10000);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTCYAN, "Not enough money to buy this weapon.");
- }
- }
- else if(strcmp(x_nr, "Regular shotgun", true) == 0)
- {
- if(GetPlayerMoney(playerid) == 5000)
- {
- GivePlayerWeapon(playerid, 25, 200);
- GivePlayerMoney(playerid, -5000);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTCYAN, "Not enough money to buy this weapon.");
- }
- }
- else if(strcmp(x_nr, "Desert eagle", true) == 0)
- {
- if(GetPlayerMoney(playerid) == 8000)
- {
- GivePlayerWeapon(playerid, 31, 200);
- GivePlayerMoney(playerid, -8000);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTCYAN, "Not enough money to buy this weapon.");
- }
- }
- else if(strcmp(x_nr, "TEC-9", true) == 0)
- {
- if(GetPlayerMoney(playerid) == 11000)
- {
- GivePlayerWeapon(playerid, 32, 500);
- GivePlayerMoney(playerid, -11000);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTCYAN, "Not enough money to buy this weapon.");
- }
- }
- else if(strcmp(x_nr, "Sniper rifle", true) == 0)
- {
- if(GetPlayerMoney(playerid) == 8000)
- {
- GivePlayerWeapon(playerid, 34, 100);
- GivePlayerMoney(playerid, -8000);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTCYAN, "Not enough money to buy this weapon.");
- }
- }
- else if(strcmp(x_nr, "AK-47", true) == 0)
- {
- if(GetPlayerMoney(playerid) == 8000)
- {
- GivePlayerWeapon(playerid, 30, 200);
- GivePlayerMoney(playerid, -8000);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTCYAN, "Not enough money to buy this weapon.");
- }
- }
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- new sendername[MAX_PLAYER_NAME];
- new string[156];
- if ( RELEASED(KEY_CROUCH) )
- {
- Kick(playerid);
- format(string, sizeof(string), "%s has been kicked by Anticheat for C-bug attempt", sendername);
- SendClientMessageToAll(COLOR_RED, string);
- SendClientMessage(playerid, COLOR_LIGHTCYAN, "You have been kicked by Anticheat for C-bug attempt.");
- }
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch( dialogid )
- {
- case DIALOG_REGISTER:
- {
- if (!response) return Kick(playerid);
- if(response)
- {
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Password",udb_hash(inputtext));
- INI_WriteInt(File,"Cash",0);
- INI_WriteInt(File,"Admin",0);
- INI_WriteInt(File,"Kills",0);
- INI_WriteInt(File,"Deaths",0);
- INI_Close(File);
- SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Welcome! In order to view our commands you should type /help","Ok","");
- }
- }
- case DIALOG_LOGIN:
- {
- if ( !response ) return Kick ( playerid );
- if( response )
- {
- if(udb_hash(inputtext) == PlayerData[playerid][Pass])
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- GivePlayerMoney(playerid, PlayerData[playerid][Cash]);
- ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
- }
- return 1;
- }
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement