16.10.2011, 19:35
Код:
#include <a_samp> #include <zcmd> #include <streamer> #include <sscanf> #include <dini> #include <dudb> #pragma unused ret_memcpy #define COLOR_GREY 0xAFAFAFAA #define COLOR_GREEN 0x33AA33AA #define red 0xFF0000FF #define COLOR_YELLOW 0xFFFF00AA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_BLUE 0x0000BBAA #define COLOR_LIGHTBLUE 0x33CCFFAA // - Ewww Aztecas colours #define orange 0xFF9900AA #define COLOR_RED 0xAA3333AA #define COLOR_LIME 0x10F441AA #define COLOR_MAGENTA 0xFF00FFFF #define COLOR_NAVY 0x000080AA #define COLOR_AQUA 0xF0F8FFAA #define COLOR_CRIMSON 0xDC143CAA #define COLOR_FLBLUE 0x6495EDAA #define COLOR_BISQUE 0xFFE4C4AA #define COLOR_BLACK 0x000000AA #define COLOR_CHARTREUSE 0x7FFF00AA #define COLOR_BROWN 0XA52A2AAA #define COLOR_CORAL 0xFF7F50AA #define COLOR_GOLD 0xB8860BAA #define COLOR_GREENYELLOW 0xADFF2FAA #define COLOR_INDIGO 0x4B00B0AA #define COLOR_IVORY 0xFFFF82AA #define COLOR_LAWNGREEN 0x7CFC00AA #define COLOR_SEAGREEN 0x20B2AAAA #define COLOR_LIMEGREEN 0x32CD32AA #define COLOR_MIDNIGHTBLUE 0X191970AA #define COLOR_MAROON 0x800000AA #define COLOR_OLIVE 0x808000AA #define COLOR_ORANGERED 0xFF4500AA #define COLOR_PINK 0xFFC0CBAA #define COLOR_SPRINGGREEN 0x00FF7FAA #define COLOR_TOMATO 0xFF6347AA #define COLOR_YELLOWGREEN 0x9ACD32AA #define COLOR_MEDIUMAQUA 0x83BFBFAA #define COLOR_MEDIUMMAGENTA 0x8B008BAA new Army1,Army2,Army3,Army4,Army5,Army6,Army7; new ID,org,str[128],alevel,Nam[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME],file[128],vlevel,IsRequesting[MAX_PLAYERS],request[MAX_PLAYERS]; new stars,Reason[128],Cuffed[MAX_PLAYERS]; enum pData { Name[MAX_PLAYER_NAME], Password[32], AdminLevel, Cash, Score, vip, Member, Leader, IsInOrg, IsLaw, IsGang, IsPriv, WantedLevel }; new Logged[MAX_PLAYERS]; new PlayerData[MAX_PLAYERS][pData]; main() { print("\n----------------------------------"); print("~Cromes Server~"); print("----------------------------------\n"); } forward Save(playerid); public Save(playerid) { if(Logged[playerid] == 1) { dini_IntSet(file, "AdminLevel",PlayerData[playerid][AdminLevel]); dini_IntSet(file, "Cash",GetPlayerMoney(playerid)); dini_IntSet(file,"Score",GetPlayerScore(playerid)); dini_IntSet(file,"Vip",PlayerData[playerid][vip]); dini_IntSet(file,"Member",PlayerData[playerid][Member]); dini_IntSet(file,"Leader",PlayerData[playerid][Leader]); dini_IntSet(file,"IsInOrg",PlayerData[playerid][IsInOrg]); dini_IntSet(file,"IsLaw",PlayerData[playerid][IsLaw]); dini_IntSet(file,"IsGang",PlayerData[playerid][IsGang]); dini_IntSet(file,"IsPriv",PlayerData[playerid][IsPriv]); dini_IntSet(file,"WantedLevel",GetPlayerWantedLevel(playerid)); } } public OnGameModeInit() { // Don't use these lines if it's a filterscript SetGameModeText("Freeroam/RolePlay"); //spawns AddPlayerClass(28,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(23,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(15,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(12,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(239,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(181,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(154,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(2,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(266,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(241,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(222,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(241,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(245,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(232,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(214,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(255,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(47,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(211,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); //org cars Army1 = AddStaticVehicle(470,285.5081,1938.0142,17.6343,179.8206,69,35); // army 1 Army2 = AddStaticVehicle(470,281.3004,1938.0024,17.6313,181.2387,109,69); // army 2 Army3 = AddStaticVehicle(470,277.6845,1937.9998,17.6320,180.0951,116,2); // army 3 Army4 = AddStaticVehicle(548,368.4410,1907.4027,22.1964,119.8845,111,22); // cargobob Army5 = AddStaticVehicle(548,368.7132,1975.8013,22.1521,94.0149,111,22); // cargobob 2 Army6 = AddStaticVehicle(433,274.5108,1935.7186,18.0765,181.6064,97,52); // barracks1 Army7 = AddStaticVehicle(433,269.3683,1935.7397,18.0778,178.9587,30,55); // barracks2 //orgcars //Private Hq CreateObject(5820,278.39941406,1896.86328125,27.53608894,0.00000000,0.00000000,0.00000000); //object(odrampbit02) (1) CreateObject(16094,191.14062500,1870.03906250,21.47656250,0.00000000,0.00000000,0.00000000); //object(des_a51infenc) (1) CreateObject(8343,305.79998779,2038.69995117,16.60000038,0.00000000,0.00000000,0.00000000); //object(vgssairportland09) (1) CreateObject(9241,369.60000610,1975.30004883,18.70000076,0.00000000,0.00000000,0.00000000); //object(copbits_sfn) (1) CreateObject(9241,370.50000000,1912.80004883,18.70000076,0.00000000,0.00000000,0.00000000); //object(copbits_sfn) (2) CreateObject(2921,266.52929688,2002.49414062,16.27141953,0.00000000,0.00000000,0.00000000); //object(kmb_cam) (1) CreateObject(987,-320.79980469,1507.39941406,74.59999847,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (1) CreateObject(987,-332.89999390,1507.09997559,74.59999847,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (2) CreateObject(987,-344.70001221,1507.09997559,74.59999847,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (3) CreateObject(987,-356.70001221,1507.19995117,74.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (4) CreateObject(987,-368.70001221,1507.09997559,74.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (5) CreateObject(987,-380.20001221,1507.09997559,74.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (6) CreateObject(987,-391.39999390,1507.19995117,74.40000153,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (7) CreateObject(987,-402.69921875,1507.09960938,74.59999847,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (8) CreateObject(987,-402.79998779,1519.09997559,74.40000153,0.00000000,0.00000000,270.00000000); //object(elecfence_bar) (9) CreateObject(987,-402.79998779,1531.09997559,74.30000305,0.00000000,0.00000000,270.00000000); //object(elecfence_bar) (10) CreateObject(987,-402.70001221,1543.00000000,74.19999695,0.00000000,0.00000000,270.00000000); //object(elecfence_bar) (11) CreateObject(987,-402.79998779,1555.00000000,73.90000153,0.00000000,0.00000000,270.00000000); //object(elecfence_bar) (12) CreateObject(987,-402.79998779,1567.09997559,73.90000153,0.00000000,0.00000000,270.00000000); //object(elecfence_bar) (13) CreateObject(987,-293.10000610,1511.40002441,74.59999847,0.00000000,0.00000000,40.00000000); //object(elecfence_bar) (1) CreateObject(987,-284.29998779,1518.69995117,74.59999847,0.00000000,0.00000000,39.99572754); //object(elecfence_bar) (1) CreateObject(987,-293.09960938,1511.39941406,74.59999847,0.00000000,0.00000000,39.99572754); //object(elecfence_bar) (1) CreateObject(987,-295.79998779,1507.00000000,74.40000153,0.00000000,0.00000000,50.99572754); //object(elecfence_bar) (1) CreateObject(987,-275.29998779,1526.30004883,74.59999847,0.00000000,0.00000000,40.00000000); //object(elecfence_bar) (1) CreateObject(987,-266.70001221,1533.50000000,74.59999847,0.00000000,0.00000000,39.99572754); //object(elecfence_bar) (1) CreateObject(987,-257.79998779,1541.40002441,74.59999847,0.00000000,0.00000000,136.00000000); //object(elecfence_bar) (1) CreateObject(987,-266.50000000,1549.59997559,74.40000153,0.00000000,0.00000000,135.99975586); //object(elecfence_bar) (1) CreateObject(987,-275.00000000,1557.80004883,74.40000153,0.00000000,0.00000000,136.00000000); //object(elecfence_bar) (1) CreateObject(987,-283.39999390,1566.09997559,74.40000153,0.00000000,0.00000000,135.99975586); //object(elecfence_bar) (1) CreateObject(987,-292.10000610,1574.40002441,74.40000153,0.00000000,0.00000000,135.99975586); //object(elecfence_bar) (1) CreateObject(987,-299.89999390,1581.90002441,74.40000153,0.00000000,0.00000000,135.99975586); //object(elecfence_bar) (1) CreateObject(987,-308.50000000,1590.19995117,74.59999847,0.00000000,0.00000000,112.99975586); //object(elecfence_bar) (1) CreateObject(987,-313.10000610,1601.00000000,73.90000153,0.00000000,0.00000000,135.99975586); //object(elecfence_bar) (1) CreateObject(987,-321.70001221,1609.09997559,73.90000153,0.00000000,0.00000000,135.99975586); //object(elecfence_bar) (1) CreateObject(987,-330.00000000,1616.80004883,73.59999847,0.00000000,0.00000000,135.99975586); //object(elecfence_bar) (1) CreateObject(987,-338.39999390,1625.09997559,73.59999847,0.00000000,0.00000000,135.99975586); //object(elecfence_bar) (1) CreateObject(987,-346.79998779,1633.30004883,73.80000305,0.00000000,0.00000000,222.99975586); //object(elecfence_bar) (1) CreateObject(987,-355.60000610,1625.19995117,74.30000305,0.00000000,0.00000000,222.99499512); //object(elecfence_bar) (1) CreateObject(987,-402.50000000,1578.80004883,73.50000000,0.00000000,0.00000000,270.00000000); //object(elecfence_bar) (13) CreateObject(746,-405.20001221,1568.59997559,73.19999695,0.00000000,0.00000000,0.00000000); //object(sm_scrub_rock2) (1) CreateObject(987,-364.39999390,1617.09997559,74.40000153,0.00000000,0.00000000,222.99499512); //object(elecfence_bar) (1) CreateObject(987,-373.29998779,1609.09997559,74.59999847,0.00000000,0.00000000,222.99499512); //object(elecfence_bar) (1) CreateObject(987,-381.89999390,1600.80004883,74.50000000,0.00000000,0.00000000,222.99499512); //object(elecfence_bar) (1) CreateObject(987,-390.50000000,1592.59997559,74.00000000,0.00000000,0.00000000,222.99499512); //object(elecfence_bar) (1) CreateObject(987,-396.50000000,1586.59997559,73.40000153,0.00000000,0.00000000,240.99218750); //object(elecfence_bar) (1) return 1; } public OnGameModeExit() { return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerPos(playerid,2537.1050,-1677.2736,19.9302); SetPlayerFacingAngle(playerid,85.8876); SetPlayerCameraPos(playerid,2526.7771,-1675.5574,19.9302); SetPlayerCameraLookAt(playerid,2526.7771,-1675.5574,19.9302); return 1; } public OnPlayerConnect(playerid) { return 1; } public OnPlayerDisconnect(playerid, reason) { GetPlayerName(playerid, pname, sizeof(pname)); switch(reason) { case 0: format(str, sizeof(str), "%s has left the server. (Lost Connection)", pname); case 1: format(str, sizeof(str), "%s has left the server. (Leaving)", pname); case 2: format(str, sizeof(str), "%s has left the server. (Kicked / Banned)",pname); } SendClientMessageToAll(0xAFAFAFAA, str); GetPlayerName(playerid,Nam, sizeof(Nam)); format(file, sizeof(file),"myserver/%s.ini",Nam); if(Logged[playerid] == 1) { dini_IntSet(file, "AdminLevel",PlayerData[playerid][AdminLevel]); dini_IntSet(file,"Cash",GetPlayerMoney(playerid)); dini_IntSet(file,"Score",GetPlayerScore(playerid)); dini_IntSet(file,"Vip",PlayerData[playerid][vip]); dini_IntSet(file,"Member",PlayerData[playerid][Member]); dini_IntSet(file,"Leader",PlayerData[playerid][Leader]); dini_IntSet(file,"IsInOrg",PlayerData[playerid][IsInOrg]); dini_IntSet(file,"IsLaw",PlayerData[playerid][IsLaw]); dini_IntSet(file,"IsGang",PlayerData[playerid][IsGang]); dini_IntSet(file,"IsPriv",PlayerData[playerid][IsPriv]); dini_IntSet(file,"WantedLevel",GetPlayerWantedLevel(playerid)); } return 1; } public OnPlayerSpawn(playerid) { if(PlayerData[playerid][Member] == 0) { SetPlayerColor(playerid,-1); } if(PlayerData[playerid][Member] == 1) { SetPlayerColor(playerid,0x1B5E23FF); GivePlayerWeapon(ID,31,5000); GivePlayerWeapon(ID,24,5000); GivePlayerWeapon(ID,29,5000); } return 1; } public OnPlayerDeath(playerid, killerid, reason) { if(GetPlayerWeapon(killerid) == 38) { new string[128], player[MAX_PLAYER_NAME]; GetPlayerName(playerid, player, sizeof(player)); format(string, sizeof(string), "%s died! Server Banned his attacker (reason: Minigun)", player); SendClientMessageToAll(COLOR_YELLOW, string); Ban(killerid); } if(PlayerData[killerid][IsLaw] == 0) { SetPlayerWantedLevel(killerid,GetPlayerWantedLevel(killerid)+1); } return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == Army1 && PlayerData[playerid][Member] !=1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This Belongs To The Sanandreas Army!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if((vid == Army2) && (PlayerData[playerid][Member] != 1)) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This Belongs To The Sanandreas Army!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if((vid == Army3) && (PlayerData[playerid][Member] != 1)) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This Belongs To The Sanandreas Army!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if((vid == Army4) && (PlayerData[playerid][Member] != 1)) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This Belongs To The Sanandreas Army!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if((vid == Army5) && (PlayerData[playerid][Member] != 1)) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This Belongs To The Sanandreas Army!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if((vid == Army6) && (PlayerData[playerid][Member] != 1)) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This Belongs To The Sanandreas Army!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if((vid == Army7) && (PlayerData[playerid][Member] != 1)) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This Belongs To The Sanandreas Army!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if((vid == Army7) && (PlayerData[playerid][Member] != 1)) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This Belongs To The Sanandreas Army!"); } } 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) { 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 OnPlayerClickPlayer(playerid, clickedplayerid, source) { return 1; } CMD:setadmin(playerid, params[]) { if(!IsPlayerAdmin(playerid))return 0; if(sscanf(params,"ui",ID,alevel)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /setadmin [ID] [Level 1-5]"); if(alevel > 5) return SendClientMessage(playerid,0xFF0000FF,"AVAILABLE LEVELS 1-5!"); if(!IsPlayerConnected(ID))return SendClientMessage(playerid,red,"That user is not connected."); if(PlayerData[ID][AdminLevel] == alevel) return SendClientMessage(playerid,0xFF0000FF, "ERROR: That person is already this admin level!"); GetPlayerName(playerid,Nam, MAX_PLAYER_NAME); GetPlayerName(ID,pname,MAX_PLAYER_NAME); if(alevel == 0) { format(str, sizeof(str),"%s has your Admin level to %d on the server. *cry *cry",Nam,alevel); SendClientMessage(ID,0xFF9900AA,str); format(str, sizeof(str),"You had set %s Admin level to %d!",pname,alevel); SendClientMessage(playerid,0xFF9900AA,str); PlayerData[ID][AdminLevel] = alevel; return 1; } format(str, sizeof(str),"%s has your Admin level to %d on the server.",Nam,alevel); SendClientMessage(ID,0xFF9900AA,str); format(str, sizeof(str),"You had set %s Admin level to %d!",pname,alevel); SendClientMessage(playerid,0xFF9900AA,str); PlayerData[ID][AdminLevel] = alevel; return 1; } CMD:setvip(playerid, params[]) { if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,0xFFFFFFAA,"SERVER: Unknown command."); if(sscanf(params,"ui",ID,vlevel)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /setvip [ID] [Level 1-3]"); if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,0xFF0000FF, "That user is not connected."); if(vlevel > 3) return SendClientMessage(playerid,0xFF0000FF,"AVAILABLE VIP LEVELS 1-3!"); if(vlevel == 0) { if(PlayerData[ID][vip] == 0) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 0 vip!"); GetPlayerName(playerid,Nam, MAX_PLAYER_NAME); GetPlayerName(ID,pname,MAX_PLAYER_NAME); format(str, sizeof(str),"%s has set your VIP Level to 0!",Nam); SendClientMessage(ID,0xFF9900AA,str); format(str,sizeof(str),"You had set %s VIP Level to 0!",pname); SendClientMessage(playerid,0xFF9900AA,str); PlayerData[ID][vip] = 0; } if(vlevel == 1) { if(PlayerData[ID][vip] == 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 1 vip!"); GetPlayerName(playerid,Nam, MAX_PLAYER_NAME); GetPlayerName(ID,pname,MAX_PLAYER_NAME); format(str, sizeof(str),"%s has set your VIP Level to 1 (BRONZE VIP)!",Nam); SendClientMessage(ID,0xFF9900AA,str); format(str, sizeof(str),"You had set %s VIP Level to 1 (BRONZE VIP)!",pname); SendClientMessage(playerid,0xFF9900AA,str); PlayerData[ID][vip] = 1; } if(vlevel == 2) { if(PlayerData[ID][vip] == 2) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 2 vip!"); GetPlayerName(playerid,Nam, MAX_PLAYER_NAME); GetPlayerName(ID,pname,MAX_PLAYER_NAME); format(str, sizeof(str),"%s has set your VIP Level to 2 (SILVER VIP)!",Nam); SendClientMessage(ID,0xFF9900AA,str); format(str, sizeof(str),"You had set %s VIP Level to 2 (SILVER VIP)!",pname); SendClientMessage(playerid,0xFF9900AA,str); PlayerData[ID][vip] = 2; } if(vlevel == 3) { if(PlayerData[ID][vip] == 3) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 3 vip!"); GetPlayerName(playerid,Nam, MAX_PLAYER_NAME); GetPlayerName(ID,pname,MAX_PLAYER_NAME); format(str, sizeof(str),"%s has set your VIP Level to 3 (GOLD VIP)!",Nam); SendClientMessage(ID,0xFF9900AA,str); format(str, sizeof(str),"You had set %s VIP Level to 3 (GOLD VIP)!",pname); SendClientMessage(playerid,0xFF9900AA,str); PlayerData[ID][vip] = 3; } return 1; } CMD:setleader(playerid,params[]) { if(!IsPlayerAdmin(playerid)) return 0; if(sscanf(params,"ui",ID,org)) return SendClientMessage(playerid,orange,"USAGE: /setleader [id] [orgid]"); GetPlayerName(playerid,Nam,sizeof(Nam)); if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,red,"ERROR: That user is not connected!"); GetPlayerName(ID,pname,sizeof(pname)); if(org == 1) { format(str,sizeof(str),"Administrator %s has set you the leader of San Andreas Army, use /lawcmds for commands",Nam); SendClientMessage(ID,orange,str); format(str,sizeof(str),"You have set %s the leader of San Andreas Army",pname); SendClientMessage(playerid,orange,str); SetPlayerColor(ID,0x1B5E23FF); SetPlayerSkin(playerid, 287); GivePlayerWeapon(ID,31,5000); GivePlayerWeapon(ID,24,5000); GivePlayerWeapon(ID,29,5000); PlayerData[ID][IsInOrg] = 1; PlayerData[ID][Member] = 1; PlayerData[ID][Leader] = 1; IsRequesting[ID] = 0; request[ID] = 0; PlayerData[ID][IsLaw] = 1; PlayerData[ID][IsGang] = 0; PlayerData[ID][IsPriv] = 0; } return 1; } CMD:kickmember(playerid,params[]) { if(PlayerData[playerid][Leader] != 1) return 0; if(sscanf(params,"us",ID,Reason)) return SendClientMessage(playerid,orange,"USAGE: /kickmember [id] [Reason]"); GetPlayerName(playerid,Nam,sizeof(Nam)); GetPlayerName(ID,pname,sizeof(pname)); if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,red,"ERROR: That user is not connected!"); if(PlayerData[ID][Member] == 1 && PlayerData[playerid][Leader] == 1) { format(str,sizeof(str),"%s has kicked you out of the organization for: %s!",Nam,Reason); SendClientMessage(ID,orange,str); format(str,sizeof(str),"You have kicked %s out your organization for: %s!",pname,Reason); SendClientMessage(playerid,orange,str); SetPlayerColor(ID,-1); ResetPlayerWeapons(ID); PlayerData[ID][Leader] = 0; PlayerData[ID][Member] = 0; PlayerData[ID][IsInOrg] = 0; IsRequesting[ID] = 0; request[ID] = 0; PlayerData[ID][IsLaw] = 0; PlayerData[ID][IsGang] = 0; PlayerData[ID][IsPriv] = 0; } return 1; } CMD:request(playerid,params[]) { if(IsRequesting[playerid] == 1) return SendClientMessage(playerid,red,"ERROR: You are already requesting for a organization, /cancelrequest"); if(PlayerData[playerid][IsInOrg] == 1) return SendClientMessage(playerid,red,"ERROR: You are in a organization!"); ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST,"Gang Request","San Andreas Army","Join","Close"); return 1; } CMD:cancelrequest(playerid, params[]) { if(request[playerid] == 0) return SendClientMessage(playerid,red,"ERROR: You are not requesting to join a organization!"); GetPlayerName(playerid,Nam,sizeof(Nam)); if(request[playerid] == 1) { format(str,sizeof(str),"%s has canceled his/her request to join San Andreas Army",Nam); SendClientMessageToAll(orange,str); IsRequesting[playerid] = 0; request[playerid] = 0; } return 1; } CMD:decline(playerid,params[]) { if(PlayerData[playerid][Leader] != 1) return 0; if(sscanf(params,"u",ID)) return SendClientMessage(playerid,orange,"USAGE: /decline [id]"); GetPlayerName(playerid,Nam,sizeof(Nam)); GetPlayerName(ID,pname,sizeof(pname)); if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,red,"ERROR: That user is not connected!"); if(PlayerData[playerid][Leader] == 1 && request[ID] == 1) { format(str,sizeof(str),"%s has declined %s Request for San Andreas Army!",Nam,pname); SendClientMessageToAll(orange,str); IsRequesting[ID] = 0; request[ID] = 0; } return 1; } CMD:accept(playerid,params[]) { if(PlayerData[playerid][Leader] != 1) return 0; if(sscanf(params,"u",ID)) return SendClientMessage(playerid,orange,"USAGE: /accept [id]"); GetPlayerName(playerid,Nam,sizeof(Nam)); GetPlayerName(ID,pname,sizeof(pname)); if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,red,"ERROR: That user is not connected!"); if(PlayerData[playerid][Leader] == 1 && request[ID] == 1) { format(str,sizeof(str),"%s has accepted your request for San Andreas Army, use /lawcmds for commands",Nam); SendClientMessage(ID,orange,str); format(str,sizeof(str),"You have accepted %s into San Andreas Army",pname); SendClientMessage(playerid,orange,str); SetPlayerColor(ID,0x1B5E23FF); SetPlayerSkin(playerid, 287); GivePlayerWeapon(ID,31,5000); GivePlayerWeapon(ID,24,5000); GivePlayerWeapon(ID,29,5000); PlayerData[ID][IsInOrg] = 1; PlayerData[ID][Member] = 1; PlayerData[ID][Leader] = 0; IsRequesting[ID] = 0; request[ID] = 0; PlayerData[ID][IsLaw] = 1; PlayerData[ID][IsGang] = 0; PlayerData[ID][IsPriv] = 0; } return 1; } CMD:leadercmds(playerid,params[]) { if(PlayerData[playerid][Leader] == 1) { SendClientMessage(playerid,-1,"LEADER CMDS:/kickmember /accept /decline"); } else return 0; return 1; } CMD:pu(playerid,params[]) { if(PlayerData[playerid][IsLaw] == 1) { SendClientMessageToAll(COLOR_BLUE,"This is the Police, Pull over right now or we will use force"); } else return 0; return 1; } CMD:lawcmds(playerid,params[]) { if(PlayerData[playerid][IsLaw] == 1) { SendClientMessage(playerid,-1,"LAWCMDS: /pu /want /cuff /uncuff /lc /wanted"); } else return 0; return 1; } CMD:gangcmds(playerid,params[]) { if(PlayerData[playerid][IsGang] == 1) { SendClientMessage(playerid,-1,"GANGCMDS: /gc"); } else return 0; return 1; } CMD:privcmds(playerid,params[]) { if(PlayerData[playerid][IsPriv] == 1) { SendClientMessage(playerid,-1,"PRIVCMDS: /pc"); } else return 0; return 1; } CMD:want(playerid,params[]) { if(PlayerData[playerid][IsLaw] == 1) { if(sscanf(params,"ui",ID,stars)) return SendClientMessage(playerid,orange,"USAGE: /want [ID][stars]"); if(stars > 6) return SendClientMessage(playerid,red,"ERROR: You cannot want over 6 stars!"); if(stars < 0) return SendClientMessage(playerid,red,"ERROR: You cannot want under 0 stars!"); if(PlayerData[ID][IsLaw] == 1) return SendClientMessage(playerid,red,"ERROR: You cannot want other law officer!"); GetPlayerName(playerid,Nam,sizeof(Nam)); GetPlayerName(ID,pname,sizeof(pname)); format(str,sizeof(str),"Officer %s has set %s wanted level to %d",Nam,pname,stars); SendClientMessageToAll(orange,str); SetPlayerWantedLevel(ID,stars); } else return 0; return 1; } CMD:cuff(playerid,params[]) { if(PlayerData[playerid][IsLaw] == 1) { if(sscanf(params,"u",ID)) return SendClientMessage(playerid,orange,"USAGE: /cuff [id]"); GetPlayerName(playerid,Nam,sizeof(Nam)); GetPlayerName(ID,pname,sizeof(pname)); if(Cuffed[ID] == 1) return SendClientMessage(playerid,red,"ERROR: That user is already cuffed!"); if(PlayerData[ID][IsLaw] == 1) return SendClientMessage(playerid,red,"ERROR: You cannot cuff another law!"); if(ID == INVALID_PLAYER_ID) SendClientMessage(playerid,red,"ERROR: That user is not connected!"); if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"ERROR: You cannot cuff people in vehicle!"); if(GetDistanceBetweenPlayers(playerid,ID) > 2) return SendClientMessage(playerid,red,"ERROR: That user is not near you!"); LoopingAnim(ID, "ped", "cower", 3.0, 1, 0, 0, 0, 0); format(str,sizeof(str),"You have been handcuffed by Officer %s",Nam); SendClientMessage(ID,orange,str); format(str,sizeof(str),"You have handcuffed %s",pname); Cuffed[ID] = 1; SendClientMessage(playerid,orange,str); TogglePlayerControllable(ID,0); } else return 0; return 1; } CMD:uncuff(playerid,params[]) { if(PlayerData[playerid][IsLaw] == 1) { if(sscanf(params,"u",ID)) return SendClientMessage(playerid,orange,"USAGE: /uncuff [id]"); GetPlayerName(playerid,Nam,sizeof(Nam)); GetPlayerName(ID,pname,sizeof(pname)); if(Cuffed[ID] == 0) return SendClientMessage(playerid,red,"ERROR: That user is not handcuffed!"); if(ID == INVALID_PLAYER_ID) SendClientMessage(playerid,red,"ERROR: That user is not connected!"); if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"ERROR: You cannot uncuff people in vehicle!"); if(GetDistanceBetweenPlayers(playerid,ID) > 2) return SendClientMessage(playerid,red,"ERROR: That user is not near you!"); format(str,sizeof(str),"You have been uncuffed by Officer %s",Nam); SendClientMessage(ID,orange,str); format(str,sizeof(str),"You have uncuffed %s",pname); SendClientMessage(playerid,orange,str); Cuffed[ID] = 0; TogglePlayerControllable(ID,1); } else return 0; return 1; } CMD:lc(playerid,params[]) { if(PlayerData[playerid][IsLaw] == 1) { if(isnull(params)) return SendClientMessage(playerid,orange,"USAGE: /lc [message]"); GetPlayerName(playerid,Nam,sizeof(Nam)); format(str,sizeof(str),"[LAWCHAT] %s: %s",Nam,params); for(new i = 0; i < MAX_PLAYERS; ++i) { if(IsPlayerConnected(i) && !IsPlayerNPC(i)) { if(PlayerData[i][IsLaw] == 1) { SendClientMessage(i,COLOR_BLUE,str); } } } } else return 0; return 1; } CMD:gc(playerid,params[]) { if(PlayerData[playerid][IsGang] == 1) { if(isnull(params)) return SendClientMessage(playerid,orange,"USAGE: /gc [message]"); GetPlayerName(playerid,Nam,sizeof(Nam)); format(str,sizeof(str),"[GANGCHAT] %s: %s",Nam,params); for(new i = 0; i < MAX_PLAYERS; ++i) { if(!IsPlayerConnected(i) && !IsPlayerNPC(i)) { if(PlayerData[i][IsGang] == 1) { SendClientMessage(i,red,str); } } } } else return 0; return 1; } CMD:orgs(playerid,params[]) { SendClientMessage(playerid,orange,"San Andreas Army || Leader: Cromehd"); return 1; } CMD:pc(playerid,params[]) { if(PlayerData[playerid][IsPriv] == 1) { if(isnull(params)) return SendClientMessage(playerid,orange,"USAGE: /pc [message]"); GetPlayerName(playerid,Nam,sizeof(Nam)); format(str,sizeof(str),"[PRIVCHAT] %s: %s",Nam,params); for(new i = 0; i < MAX_PLAYERS; ++i) { if(!IsPlayerConnected(i) && !IsPlayerNPC(i)) { if(PlayerData[i][IsPriv] == 1) { SendClientMessage(i,COLOR_GREY,str); } } } } else return 0; return 1; } CMD:wanted(playerid,params[]) { if(PlayerData[playerid][IsLaw] == 1) { SendClientMessage(playerid,orange,"Wanted List"); for(new i; i < MAX_PLAYERS; i++) { GetPlayerName(i,Nam, sizeof(Nam)); if(GetPlayerWantedLevel(i) >= 1) { format(str, sizeof str, "%s - Wanted Level: %d",Nam, GetPlayerWantedLevel(i)); SendClientMessage(playerid,orange, str); } } } else return 0; return 1; } stock GetDistanceBetweenPlayers(playerid,playerid2) { new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2; new Float:tmpdis; GetPlayerPos(playerid,x1,y1,z1); GetPlayerPos(playerid2,x2,y2,z2); tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2)); return floatround(tmpdis); } new gPlayerUsingLoopingAnim[MAX_PLAYERS]; new animation[200]; LoopingAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp) { gPlayerUsingLoopingAnim[playerid] = 1; ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp); animation[playerid]++; }