public OnGameModeInit() { SAPD1 = AddStaticVehicle(596,1526.1974,-1644.9664,5.6117,179.4196,0,1); // SAPD2 = AddStaticVehicle(596,1530.2972,-1644.6364,5.6114,183.0269,0,1); // SAPD3 = AddStaticVehicle(596,1534.7595,-1645.1321,5.6100,182.9272,0,1); // SAPD4 = AddStaticVehicle(596,1538.2792,-1644.0007,5.6117,180.8078,0,1); // SAPD5 = AddStaticVehicle(601,1558.2723,-1711.4982,5.6493,357.9770,1,1); // SAPD6 = AddStaticVehicle(601,1564.1008,-1711.4202,5.6494,359.0573,1,1); // SAPD7 = AddStaticVehicle(601,1570.6998,-1710.4611,5.6495,359.6237,1,1); // SAPD8 = AddStaticVehicle(601,1574.5095,-1711.9756,5.6494,0.2955,1,1); // SAPD9 = AddStaticVehicle(596,1601.1709,-1700.2358,5.6115,88.8725,0,1); // SAPD10 = AddStaticVehicle(596,1602.2048,-1692.2645,5.6117,89.7542,0,1); // SAPD11 = AddStaticVehicle(596,1602.3357,-1684.2694,5.6119,90.7812,0,1); // SAPD12 = AddStaticVehicle(599,1603.2042,-1687.8186,5.9862,90.1683,0,1); // SAPD13 = AddStaticVehicle(599,1527.3236,-1687.7910,5.9863,269.7841,0,1); // SAPD14 = AddStaticVehicle(599,1543.7686,-1684.1729,5.9858,93.4536,0,1); // return 1; }
public OnGameModeInit() { AddStaticVehicle(596,1526.1974,-1644.9664,5.6117,179.4196,0,1); // SAPD1 AddStaticVehicle(596,1530.2972,-1644.6364,5.6114,183.0269,0,1); // SAPD2 AddStaticVehicle(596,1534.7595,-1645.1321,5.6100,182.9272,0,1); // SAPD3 AddStaticVehicle(596,1538.2792,-1644.0007,5.6117,180.8078,0,1); // SAPD4 AddStaticVehicle(601,1558.2723,-1711.4982,5.6493,357.9770,1,1); // SAPD5 AddStaticVehicle(601,1564.1008,-1711.4202,5.6494,359.0573,1,1); // SAPD6 AddStaticVehicle(601,1570.6998,-1710.4611,5.6495,359.6237,1,1); // SAPD 7 AddStaticVehicle(601,1574.5095,-1711.9756,5.6494,0.2955,1,1); // SAPD 8 AddStaticVehicle(596,1601.1709,-1700.2358,5.6115,88.8725,0,1); // SAPD 9 AddStaticVehicle(596,1602.2048,-1692.2645,5.6117,89.7542,0,1); // SAPD 10 AddStaticVehicle(596,1602.3357,-1684.2694,5.6119,90.7812,0,1); // SAPD 11 AddStaticVehicle(599,1603.2042,-1687.8186,5.9862,90.1683,0,1); // SAPD 12 AddStaticVehicle(599,1527.3236,-1687.7910,5.9863,269.7841,0,1); // SAPD 13 AddStaticVehicle(599,1543.7686,-1684.1729,5.9858,93.4536,0,1); // SAPD 14 return 1; }
#include <a_samp> #include zcmd #include dini #include sscanf #define White 0xFFFFFFFF #define SAPD_COLOR 0x3EA3F4FF #define LSA_COLOR 0xFF0080FF #define Yellow 0xFFFF00FF #define yellow 0xFFFF00AA #define red 0xFF0000AA #define green 0x45E01FFF new Name[MAX_PLAYERS]; new pname[MAX_PLAYERS]; new String[MAX_PLAYERS]; new Member[MAX_PLAYERS];//If the player is a Member. new Leader[MAX_PLAYERS];//If the player is a Leader. new IsInOrg[MAX_PLAYERS];//If the player is in the org. new IsLaw[MAX_PLAYERS];//If the org is a law org. new IsPriv[MAX_PLAYERS]; new IsGang[MAX_PLAYERS]; new OrgId[MAX_PLAYERS];//This is the id of the or that is being requested. new request[MAX_PLAYERS];//Request new IsRequesting[MAX_PLAYERS];//If the player is requesting an org. new file[MAX_PLAYERS]; new FSave[1000]; new SAPD1,SAPD2,SAPD3,SAPD4,SAPD5,SAPD6,SAPD7,SAPD8,SAPD9,SAPD10,SAPD11,SAPD12,SAPD13,SAPD14 public OnGameModeInit() { SAPD1 = AddStaticVehicle(596,1526.1974,-1644.9664,5.6117,179.4196,0,1); // SAPD2 = AddStaticVehicle(596,1530.2972,-1644.6364,5.6114,183.0269,0,1); // SAPD3 = AddStaticVehicle(596,1534.7595,-1645.1321,5.6100,182.9272,0,1); // SAPD4 = AddStaticVehicle(596,1538.2792,-1644.0007,5.6117,180.8078,0,1); // SAPD5 = AddStaticVehicle(601,1558.2723,-1711.4982,5.6493,357.9770,1,1); // SAPD6 = AddStaticVehicle(601,1564.1008,-1711.4202,5.6494,359.0573,1,1); // SAPD7 = AddStaticVehicle(601,1570.6998,-1710.4611,5.6495,359.6237,1,1); // SAPD8 = AddStaticVehicle(601,1574.5095,-1711.9756,5.6494,0.2955,1,1); // SAPD9 = AddStaticVehicle(596,1601.1709,-1700.2358,5.6115,88.8725,0,1); // SAPD10 = AddStaticVehicle(596,1602.2048,-1692.2645,5.6117,89.7542,0,1); // SAPD11 = AddStaticVehicle(596,1602.3357,-1684.2694,5.6119,90.7812,0,1); // SAPD12 = AddStaticVehicle(599,1603.2042,-1687.8186,5.9862,90.1683,0,1); // SAPD13 = AddStaticVehicle(599,1527.3236,-1687.7910,5.9863,269.7841,0,1); // SAPD14 = AddStaticVehicle(599,1543.7686,-1684.1729,5.9858,93.4536,0,1); // return 1; } public OnPlayerConnect(playerid) { GetPlayerName(playerid, Name, sizeof(Name)); format(file,sizeof(file),"OrgUsers/%s.ini", Name); if(dini_Exists(file)) { Member[playerid] = dini_Int(file, "Member"); Leader[playerid] = dini_Int(file,"Leader"); IsInOrg[playerid] = dini_Int(file,"Status"); IsLaw[playerid] = dini_Int(file,"Law"); request[playerid] = dini_Int(file,"Request"); IsRequesting[playerid] = dini_Int(file,"Isrequesting"); } return 1; } public OnPlayerDisconnect(playerid, reason) { GetPlayerName(playerid, Name, sizeof(Name)); format(file,sizeof(file),"OrgUsers/%s.ini", Name); if(dini_Exists(file)) { dini_IntSet(file, "Member", Member[playerid]); dini_IntSet(file, "Leader", Leader[playerid]); dini_IntSet(file, "Status", IsInOrg[playerid]); dini_IntSet(file, "Request", request[playerid]); dini_IntSet(file, "IsRequesting", IsRequesting[playerid]); } return 1; } public OnPlayerSpawn(playerid) { FSave[playerid] = SetTimerEx("Save",1000,true,"i",playerid);//This creates a timer when the player spawns and it saves the file ever 1 second. if(Member[playerid] == 1) { SetPlayerColor(playerid,SAPD_COLOR); SetPlayerSkin(playerid, 280); GivePlayerWeapon(playerid,31,5000); GivePlayerWeapon(playerid,3,-1); GivePlayerWeapon(playerid,24,500); SendClientMessage(playerid,White,"Organization: San Andreas Police Departmaent."); } if(Member[playerid] == 2) { SetPlayerColor(playerid,LSA_COLOR); SetPlayerSkin(playerid, 287); GivePlayerWeapon(playerid,22,1000); GivePlayerWeapon(playerid,32,5000); SendClientMessage(playerid,White,"Organization: Los Santos Army."); } if(Member[playerid] == 3) { SetPlayerColor(playerid,LSA_COLOR); SetPlayerSkin(playerid, 165); GivePlayerWeapon(playerid,22,1000); GivePlayerWeapon(playerid,32,5000); SendClientMessage(playerid,White,"Organization: FBI."); } return 1; } COMMAND:kickmember(playerid, params[]) { new id; if(sscanf(params,"u", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /kickmember [id]"); GetPlayerName(playerid, Name, sizeof(Name)); if(Member[id] == 1 && Leader[playerid] == 1) { format(String, sizeof(String), "%s has kicked you from San Andreas Police Dept.",Name); SendClientMessage(id,0xFF0000FF, String); SetPlayerColor(id,0xFFFFFFFF); ResetPlayerWeapons(id); Leader[id] = 0; Member[id] = 0; IsInOrg[id] = 0; OrgId[id] = 0; IsLaw[id] = 0; IsPriv[id] = 0; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; format(String, sizeof(String), "You have kicked a player from San Andreas Police Dept",Name); SendClientMessage(playerid,0xFF0000FF, String); TogglePlayerControllable(id,true); } if(Member[id] == 2 && Leader[playerid] == 2) { format(String, sizeof(String), "%s has kicked you from Los Santos Army.",Name); SendClientMessage(id,0xFF0000FF, String); SetPlayerColor(id,0xFFFFFFFF); ResetPlayerWeapons(id); Leader[id] = 0; Member[id] = 0; IsInOrg[id] = 0; OrgId[id] = 0; IsLaw[id] = 0; IsPriv[id] = 0; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; format(String, sizeof(String), "You have kicked a player from Los Santos Army.",Name); SendClientMessage(playerid,0xFF0000FF, String); TogglePlayerControllable(id,true); } if(Member[id] == 3 && Leader[playerid] == 3) { format(String, sizeof(String), "%s has kicked you from FBI.",Name); SendClientMessage(id,0xFF0000FF, String); SetPlayerColor(id,0xFFFFFFFF); ResetPlayerWeapons(id); Leader[id] = 0; Member[id] = 0; IsInOrg[id] = 0; OrgId[id] = 0; IsLaw[id] = 0; IsPriv[id] = 0; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; format(String, sizeof(String), "You have kicked a player from FBI.",Name); SendClientMessage(playerid,0xFF0000FF, String); TogglePlayerControllable(id,true); } return 1; } COMMAND:accept(playerid, params[]) { new id; if(IsPlayerConnected(id)) if(sscanf(params,"u", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /accept [id]"); if(IsInOrg[id] == 1) return SendClientMessage(playerid,red,"This user is already in an organization!"); if(request[id] == 0) return SendClientMessage(playerid,red,"Ths user is not requesting to your organization!"); if(Leader[playerid] == 1 && Member[id] == 0 && request[id] == 1) { GetPlayerName(playerid, Name, sizeof(Name)); format(String, sizeof(String), "%s has accepted your application into San Andreas Police Dept.Please type /lawcmds",Name); SendClientMessage(id,green, String); Leader[id] = 0; Member[id] = 1; IsInOrg[id] = 1; OrgId[id] = 1; IsLaw[id] = 1; IsPriv[id] = 0; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; SetPlayerSkin(id, 280); GivePlayerWeapon(id,24,500); GivePlayerWeapon(id,3,-1); GivePlayerWeapon(id,31,5000); SetPlayerColor(id,SAPD_COLOR); format(String, sizeof(String), "You have set a player member of San Andreas Police Dept.",Name); SendClientMessage(playerid,green, String); } if(IsInOrg[id] == 1) return SendClientMessage(playerid,red,"This user is already in an organization!"); if(request[id] == 0) return SendClientMessage(playerid,red,"Ths user is not requesting to your organization"); if(Leader[playerid] == 2 && Member[id] == 0 && request[id] == 2) { format(String, sizeof(String), "%s has accepted your application into Los Santos Army. Please type /orgcmds",Name); SendClientMessage(id,green, String); Leader[id] = 0; Member[id] = 2; IsInOrg[id] = 1; OrgId[id] = 2; IsLaw[id] = 0; IsPriv[id] = 1; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; SetPlayerSkin(id, 287); GivePlayerWeapon(id,22,500); GivePlayerWeapon(id,32,5000); SetPlayerColor(id,LSA_COLOR); format(String, sizeof(String), "You have set a player member of Los Santos Army.",Name); SendClientMessage(playerid,green, String); } if(IsInOrg[id] == 1) return SendClientMessage(playerid,red,"This user is already in an organization!"); if(request[id] == 0) return SendClientMessage(playerid,red,"Ths user is not requesting to your organization"); if(Leader[playerid] == 3 && Member[id] == 0 && request[id] == 3) { format(String, sizeof(String), "%s has accepted your application into FBI. Please type /orgcmds",Name); SendClientMessage(id,green, String); Leader[id] = 0; Member[id] = 2; IsInOrg[id] = 1; OrgId[id] = 3; IsLaw[id] = 1; IsPriv[id] = 0; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; SetPlayerSkin(id, 165); GivePlayerWeapon(id,22,500); GivePlayerWeapon(id,32,5000); SetPlayerColor(id,LSA_COLOR); format(String, sizeof(String), "You have set a player member of FBI.",Name); SendClientMessage(playerid,green, String); } return 1; } COMMAND:request(playerid, params[]) { new id; if(sscanf(params,"i", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /request [orgid]"); GetPlayerName(playerid, Name, sizeof(Name)); if(IsInOrg[playerid] == 1) return SendClientMessage(playerid, red," You are already in a organisation!"); if(IsRequesting[playerid] == 1) return SendClientMessage(playerid, red," You are already requesting to join an organisation!"); if(id == 1) { format(String,MAX_PLAYERS,"* %s is requesting to join San Andreas Police Dept.",Name); SendClientMessageToAll(SAPD_COLOR,String); IsRequesting[playerid] = 1; request[playerid] = 1; return 1; } if(id == 2) { format(String,MAX_PLAYERS,"* %s is requesting to join Los Santos Army.",Name); SendClientMessageToAll(LSA_COLOR,String); IsRequesting[playerid] = 1; request[playerid] = 2; return 1; } if(id == 3) { format(String,MAX_PLAYERS,"* %s is requesting to join FBI.",Name); SendClientMessageToAll(LSA_COLOR,String); IsRequesting[playerid] = 1; request[playerid] = 2; return 1; } return 1; } COMMAND:cancelrequest(playerid, params[]) { if(request[playerid] == 0) return SendClientMessage(playerid,red,"You are not requesting to join any organization!"); GetPlayerName(playerid,pname,sizeof(pname)); if(request[playerid] == 1) { format(String,MAX_PLAYERS,"* %s has cancelled his request to join San Andreas Police Department.",pname); SendClientMessageToAll(0x8F8F8FFF,String); IsRequesting[playerid] = 0; request[playerid] = 0; return 1; } if(request[playerid] == 2) { format(String,MAX_PLAYERS,"* %s has cancelled his request to join Los Santos Army.",pname); SendClientMessageToAll(0x8F8F8FFF,String); IsRequesting[playerid] = 0; request[playerid] = 0; return 1; } if(request[playerid] == 3) { format(String,MAX_PLAYERS,"* %s has cancelled his request to join FBI.",pname); SendClientMessageToAll(0x8F8F8FFF,String); IsRequesting[playerid] = 0; request[playerid] = 0; return 1; } return 1; } COMMAND:setleader(playerid, params[])//Set Leader to San Andreas Police Department. { new id,oleader; if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,0xDFDFDFFF,"You are not an admin."); if(sscanf(params,"ui", id,oleader))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /setleader [id] [orgID 1 - 9]"); if(oleader > 9)return SendClientMessage(playerid,red,"Please type /orgids"); if(oleader == 1) { GetPlayerName(playerid, Name, sizeof(Name)); format(String, sizeof(String), "%s has set you the leader of San Andreas Police Dept.",Name); SendClientMessage(id,green, String); SetPlayerColor(id,SAPD_COLOR); SetPlayerSkin(id, 282); GivePlayerWeapon(id,24,500); GivePlayerWeapon(id,3,-1); GivePlayerWeapon(id,31,5000); Leader[id] = 1; Member[id] = 1; IsInOrg[id] = 1; OrgId[id] = 1; IsLaw[id] = 1; IsPriv[id] = 0; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; format(String, sizeof(String), "You have set a new leader for San Andreas Police Dept.",Name); SendClientMessage(playerid,green, String); } if(oleader == 2) { GetPlayerName(playerid, Name, sizeof(Name)); format(String, sizeof(String), "%s has set you the leader of Los Santos Army.",Name); SendClientMessage(id,green, String); SetPlayerColor(id,LSA_COLOR); SetPlayerSkin(id, 287); GivePlayerWeapon(id,22,500); GivePlayerWeapon(id,32,5000); Leader[id] = 2; Member[id] = 2; IsInOrg[id] = 1; OrgId[id] = 2; IsLaw[id] = 1; IsPriv[id] = 0; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; format(String, sizeof(String), "You have set a new leader for Los Santos Army.",Name); SendClientMessage(playerid,green, String); } if(oleader == 3) { GetPlayerName(playerid, Name, sizeof(Name)); format(String, sizeof(String), "%s has set you the leader of FBI.",Name); SendClientMessage(id,green, String); SetPlayerColor(id,LSA_COLOR); SetPlayerSkin(id, 286); GivePlayerWeapon(id,22,500); GivePlayerWeapon(id,32,5000); Leader[id] = 3; Member[id] = 3; IsInOrg[id] = 1; OrgId[id] = 3; IsLaw[id] = 1; IsPriv[id] = 0; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; format(String, sizeof(String), "You have set a new leader for FBI.",Name); SendClientMessage(playerid,green, String); } return 1; } forward Save(playerid); public Save(playerid) { GetPlayerName(playerid, pname, sizeof(pname)); format(file, sizeof(file), "OrgUsers/%s",pname); if(dini_Exists(file)) { dini_Create(file); dini_IntSet(file, "Member", Member[playerid]); dini_IntSet(file, "Leader", Leader[playerid]); dini_IntSet(file, "Status", IsInOrg[playerid]); dini_IntSet(file, "Law", IsLaw[playerid]); dini_IntSet(file, "Gang", IsGang[playerid]); dini_IntSet(file, "Priv", IsPriv[playerid]); dini_IntSet(file, "Request", request[playerid]); dini_IntSet(file, "IsRequesting", IsRequesting[playerid]); } return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD1 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD2 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD3 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD4 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD5 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD6 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD7 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD8 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD9 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD10 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD11 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD12 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD13 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD14 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } return 1; }
new SAPD1,SAPD2,SAPD3,SAPD4,SAPD5,SAPD6,SAPD7,SAPD8,SAPD9,SAPD10,SAPD11,SAPD12,SAPD13,SAPD14
new SAPD1,SAPD2,SAPD3,SAPD4,SAPD5,SAPD6,SAPD7,SAPD8,SAPD9,SAPD10,SAPD11,SAPD12,SAPD13,SAPD14;
#include <a_samp> #include zcmd #include dini #include sscanf #define White 0xFFFFFFFF #define SAPD_COLOR 0x3EA3F4FF #define LSA_COLOR 0xFF0080FF #define Yellow 0xFFFF00FF #define yellow 0xFFFF00AA #define red 0xFF0000AA #define green 0x45E01FFF new Name[MAX_PLAYERS]; new pname[MAX_PLAYERS]; new String[MAX_PLAYERS]; new Member[MAX_PLAYERS];//If the player is a Member. new Leader[MAX_PLAYERS];//If the player is a Leader. new IsInOrg[MAX_PLAYERS];//If the player is in the org. new IsLaw[MAX_PLAYERS];//If the org is a law org. new IsPriv[MAX_PLAYERS]; new IsGang[MAX_PLAYERS]; new OrgId[MAX_PLAYERS];//This is the id of the or that is being requested. new request[MAX_PLAYERS];//Request new IsRequesting[MAX_PLAYERS];//If the player is requesting an org. new file[MAX_PLAYERS]; new FSave[1000]; new SAPD1,SAPD2,SAPD3,SAPD4,SAPD5,SAPD6,SAPD7,SAPD8,SAPD9,SAPD10,SAPD11,SAPD12,SAPD13,SAPD14; public OnGameModeInit() { SAPD1 = AddStaticVehicle(596,1526.1974,-1644.9664,5.6117,179.4196,0,1); // SAPD2 = AddStaticVehicle(596,1530.2972,-1644.6364,5.6114,183.0269,0,1); // SAPD3 = AddStaticVehicle(596,1534.7595,-1645.1321,5.6100,182.9272,0,1); // SAPD4 = AddStaticVehicle(596,1538.2792,-1644.0007,5.6117,180.8078,0,1); // SAPD5 = AddStaticVehicle(601,1558.2723,-1711.4982,5.6493,357.9770,1,1); // SAPD6 = AddStaticVehicle(601,1564.1008,-1711.4202,5.6494,359.0573,1,1); // SAPD7 = AddStaticVehicle(601,1570.6998,-1710.4611,5.6495,359.6237,1,1); // SAPD8 = AddStaticVehicle(601,1574.5095,-1711.9756,5.6494,0.2955,1,1); // SAPD9 = AddStaticVehicle(596,1601.1709,-1700.2358,5.6115,88.8725,0,1); // SAPD10 = AddStaticVehicle(596,1602.2048,-1692.2645,5.6117,89.7542,0,1); // SAPD11 = AddStaticVehicle(596,1602.3357,-1684.2694,5.6119,90.7812,0,1); // SAPD12 = AddStaticVehicle(599,1603.2042,-1687.8186,5.9862,90.1683,0,1); // SAPD13 = AddStaticVehicle(599,1527.3236,-1687.7910,5.9863,269.7841,0,1); // SAPD14 = AddStaticVehicle(599,1543.7686,-1684.1729,5.9858,93.4536,0,1); // return 1; } public OnPlayerConnect(playerid) { GetPlayerName(playerid, Name, sizeof(Name)); format(file,sizeof(file),"OrgUsers/%s.ini", Name); if(dini_Exists(file)) { Member[playerid] = dini_Int(file, "Member"); Leader[playerid] = dini_Int(file,"Leader"); IsInOrg[playerid] = dini_Int(file,"Status"); IsLaw[playerid] = dini_Int(file,"Law"); request[playerid] = dini_Int(file,"Request"); IsRequesting[playerid] = dini_Int(file,"Isrequesting"); } return 1; } public OnPlayerDisconnect(playerid, reason) { GetPlayerName(playerid, Name, sizeof(Name)); format(file,sizeof(file),"OrgUsers/%s.ini", Name); if(dini_Exists(file)) { dini_IntSet(file, "Member", Member[playerid]); dini_IntSet(file, "Leader", Leader[playerid]); dini_IntSet(file, "Status", IsInOrg[playerid]); dini_IntSet(file, "Request", request[playerid]); dini_IntSet(file, "IsRequesting", IsRequesting[playerid]); } return 1; } public OnPlayerSpawn(playerid) { FSave[playerid] = SetTimerEx("Save",1000,true,"i",playerid);//This creates a timer when the player spawns and it saves the file ever 1 second. if(Member[playerid] == 1) { SetPlayerColor(playerid,SAPD_COLOR); SetPlayerSkin(playerid, 280); GivePlayerWeapon(playerid,31,5000); GivePlayerWeapon(playerid,3,-1); GivePlayerWeapon(playerid,24,500); SendClientMessage(playerid,White,"Organization: San Andreas Police Departmaent."); } if(Member[playerid] == 2) { SetPlayerColor(playerid,LSA_COLOR); SetPlayerSkin(playerid, 287); GivePlayerWeapon(playerid,22,1000); GivePlayerWeapon(playerid,32,5000); SendClientMessage(playerid,White,"Organization: Los Santos Army."); } if(Member[playerid] == 3) { SetPlayerColor(playerid,LSA_COLOR); SetPlayerSkin(playerid, 165); GivePlayerWeapon(playerid,22,1000); GivePlayerWeapon(playerid,32,5000); SendClientMessage(playerid,White,"Organization: FBI."); } return 1; } COMMAND:kickmember(playerid, params[]) { new id; if(sscanf(params,"u", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /kickmember [id]"); GetPlayerName(playerid, Name, sizeof(Name)); if(Member[id] == 1 && Leader[playerid] == 1) { format(String, sizeof(String), "%s has kicked you from San Andreas Police Dept.",Name); SendClientMessage(id,0xFF0000FF, String); SetPlayerColor(id,0xFFFFFFFF); ResetPlayerWeapons(id); Leader[id] = 0; Member[id] = 0; IsInOrg[id] = 0; OrgId[id] = 0; IsLaw[id] = 0; IsPriv[id] = 0; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; format(String, sizeof(String), "You have kicked a player from San Andreas Police Dept",Name); SendClientMessage(playerid,0xFF0000FF, String); TogglePlayerControllable(id,true); } if(Member[id] == 2 && Leader[playerid] == 2) { format(String, sizeof(String), "%s has kicked you from Los Santos Army.",Name); SendClientMessage(id,0xFF0000FF, String); SetPlayerColor(id,0xFFFFFFFF); ResetPlayerWeapons(id); Leader[id] = 0; Member[id] = 0; IsInOrg[id] = 0; OrgId[id] = 0; IsLaw[id] = 0; IsPriv[id] = 0; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; format(String, sizeof(String), "You have kicked a player from Los Santos Army.",Name); SendClientMessage(playerid,0xFF0000FF, String); TogglePlayerControllable(id,true); } if(Member[id] == 3 && Leader[playerid] == 3) { format(String, sizeof(String), "%s has kicked you from FBI.",Name); SendClientMessage(id,0xFF0000FF, String); SetPlayerColor(id,0xFFFFFFFF); ResetPlayerWeapons(id); Leader[id] = 0; Member[id] = 0; IsInOrg[id] = 0; OrgId[id] = 0; IsLaw[id] = 0; IsPriv[id] = 0; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; format(String, sizeof(String), "You have kicked a player from FBI.",Name); SendClientMessage(playerid,0xFF0000FF, String); TogglePlayerControllable(id,true); } return 1; } COMMAND:accept(playerid, params[]) { new id; if(IsPlayerConnected(id)) if(sscanf(params,"u", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /accept [id]"); if(IsInOrg[id] == 1) return SendClientMessage(playerid,red,"This user is already in an organization!"); if(request[id] == 0) return SendClientMessage(playerid,red,"Ths user is not requesting to your organization!"); if(Leader[playerid] == 1 && Member[id] == 0 && request[id] == 1) { GetPlayerName(playerid, Name, sizeof(Name)); format(String, sizeof(String), "%s has accepted your application into San Andreas Police Dept.Please type /lawcmds",Name); SendClientMessage(id,green, String); Leader[id] = 0; Member[id] = 1; IsInOrg[id] = 1; OrgId[id] = 1; IsLaw[id] = 1; IsPriv[id] = 0; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; SetPlayerSkin(id, 280); GivePlayerWeapon(id,24,500); GivePlayerWeapon(id,3,-1); GivePlayerWeapon(id,31,5000); SetPlayerColor(id,SAPD_COLOR); format(String, sizeof(String), "You have set a player member of San Andreas Police Dept.",Name); SendClientMessage(playerid,green, String); } if(IsInOrg[id] == 1) return SendClientMessage(playerid,red,"This user is already in an organization!"); if(request[id] == 0) return SendClientMessage(playerid,red,"Ths user is not requesting to your organization"); if(Leader[playerid] == 2 && Member[id] == 0 && request[id] == 2) { format(String, sizeof(String), "%s has accepted your application into Los Santos Army. Please type /orgcmds",Name); SendClientMessage(id,green, String); Leader[id] = 0; Member[id] = 2; IsInOrg[id] = 1; OrgId[id] = 2; IsLaw[id] = 0; IsPriv[id] = 1; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; SetPlayerSkin(id, 287); GivePlayerWeapon(id,22,500); GivePlayerWeapon(id,32,5000); SetPlayerColor(id,LSA_COLOR); format(String, sizeof(String), "You have set a player member of Los Santos Army.",Name); SendClientMessage(playerid,green, String); } if(IsInOrg[id] == 1) return SendClientMessage(playerid,red,"This user is already in an organization!"); if(request[id] == 0) return SendClientMessage(playerid,red,"Ths user is not requesting to your organization"); if(Leader[playerid] == 3 && Member[id] == 0 && request[id] == 3) { format(String, sizeof(String), "%s has accepted your application into FBI. Please type /orgcmds",Name); SendClientMessage(id,green, String); Leader[id] = 0; Member[id] = 2; IsInOrg[id] = 1; OrgId[id] = 3; IsLaw[id] = 1; IsPriv[id] = 0; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; SetPlayerSkin(id, 165); GivePlayerWeapon(id,22,500); GivePlayerWeapon(id,32,5000); SetPlayerColor(id,LSA_COLOR); format(String, sizeof(String), "You have set a player member of FBI.",Name); SendClientMessage(playerid,green, String); } return 1; } COMMAND:request(playerid, params[]) { new id; if(sscanf(params,"i", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /request [orgid]"); GetPlayerName(playerid, Name, sizeof(Name)); if(IsInOrg[playerid] == 1) return SendClientMessage(playerid, red," You are already in a organisation!"); if(IsRequesting[playerid] == 1) return SendClientMessage(playerid, red," You are already requesting to join an organisation!"); if(id == 1) { format(String,MAX_PLAYERS,"* %s is requesting to join San Andreas Police Dept.",Name); SendClientMessageToAll(SAPD_COLOR,String); IsRequesting[playerid] = 1; request[playerid] = 1; return 1; } if(id == 2) { format(String,MAX_PLAYERS,"* %s is requesting to join Los Santos Army.",Name); SendClientMessageToAll(LSA_COLOR,String); IsRequesting[playerid] = 1; request[playerid] = 2; return 1; } if(id == 3) { format(String,MAX_PLAYERS,"* %s is requesting to join FBI.",Name); SendClientMessageToAll(LSA_COLOR,String); IsRequesting[playerid] = 1; request[playerid] = 2; return 1; } return 1; } COMMAND:cancelrequest(playerid, params[]) { if(request[playerid] == 0) return SendClientMessage(playerid,red,"You are not requesting to join any organization!"); GetPlayerName(playerid,pname,sizeof(pname)); if(request[playerid] == 1) { format(String,MAX_PLAYERS,"* %s has cancelled his request to join San Andreas Police Department.",pname); SendClientMessageToAll(0x8F8F8FFF,String); IsRequesting[playerid] = 0; request[playerid] = 0; return 1; } if(request[playerid] == 2) { format(String,MAX_PLAYERS,"* %s has cancelled his request to join Los Santos Army.",pname); SendClientMessageToAll(0x8F8F8FFF,String); IsRequesting[playerid] = 0; request[playerid] = 0; return 1; } if(request[playerid] == 3) { format(String,MAX_PLAYERS,"* %s has cancelled his request to join FBI.",pname); SendClientMessageToAll(0x8F8F8FFF,String); IsRequesting[playerid] = 0; request[playerid] = 0; return 1; } return 1; } COMMAND:setleader(playerid, params[])//Set Leader to San Andreas Police Department. { new id,oleader; if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,0xDFDFDFFF,"You are not an admin."); if(sscanf(params,"ui", id,oleader))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /setleader [id] [orgID 1 - 9]"); if(oleader > 9)return SendClientMessage(playerid,red,"Please type /orgids"); if(oleader == 1) { GetPlayerName(playerid, Name, sizeof(Name)); format(String, sizeof(String), "%s has set you the leader of San Andreas Police Dept.",Name); SendClientMessage(id,green, String); SetPlayerColor(id,SAPD_COLOR); SetPlayerSkin(id, 282); GivePlayerWeapon(id,24,500); GivePlayerWeapon(id,3,-1); GivePlayerWeapon(id,31,5000); Leader[id] = 1; Member[id] = 1; IsInOrg[id] = 1; OrgId[id] = 1; IsLaw[id] = 1; IsPriv[id] = 0; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; format(String, sizeof(String), "You have set a new leader for San Andreas Police Dept.",Name); SendClientMessage(playerid,green, String); } if(oleader == 2) { GetPlayerName(playerid, Name, sizeof(Name)); format(String, sizeof(String), "%s has set you the leader of Los Santos Army.",Name); SendClientMessage(id,green, String); SetPlayerColor(id,LSA_COLOR); SetPlayerSkin(id, 287); GivePlayerWeapon(id,22,500); GivePlayerWeapon(id,32,5000); Leader[id] = 2; Member[id] = 2; IsInOrg[id] = 1; OrgId[id] = 2; IsLaw[id] = 1; IsPriv[id] = 0; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; format(String, sizeof(String), "You have set a new leader for Los Santos Army.",Name); SendClientMessage(playerid,green, String); } if(oleader == 3) { GetPlayerName(playerid, Name, sizeof(Name)); format(String, sizeof(String), "%s has set you the leader of FBI.",Name); SendClientMessage(id,green, String); SetPlayerColor(id,LSA_COLOR); SetPlayerSkin(id, 286); GivePlayerWeapon(id,22,500); GivePlayerWeapon(id,32,5000); Leader[id] = 3; Member[id] = 3; IsInOrg[id] = 1; OrgId[id] = 3; IsLaw[id] = 1; IsPriv[id] = 0; IsGang[id] = 0; IsRequesting[id] = 0; request[id] = 0; format(String, sizeof(String), "You have set a new leader for FBI.",Name); SendClientMessage(playerid,green, String); } return 1; } forward Save(playerid); public Save(playerid) { GetPlayerName(playerid, pname, sizeof(pname)); format(file, sizeof(file), "OrgUsers/%s",pname); if(dini_Exists(file)) { dini_Create(file); dini_IntSet(file, "Member", Member[playerid]); dini_IntSet(file, "Leader", Leader[playerid]); dini_IntSet(file, "Status", IsInOrg[playerid]); dini_IntSet(file, "Law", IsLaw[playerid]); dini_IntSet(file, "Gang", IsGang[playerid]); dini_IntSet(file, "Priv", IsPriv[playerid]); dini_IntSet(file, "Request", request[playerid]); dini_IntSet(file, "IsRequesting", IsRequesting[playerid]); } return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD1 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD2 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD3 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD4 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD5 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD6 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD7 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD8 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD9 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD10 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD11 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD12 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD13 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == SAPD14 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This is an Organization vehicle!"); } } return 1; }
#include <a_samp>
#include zcmd
#include dini
#include sscanf
#define White 0xFFFFFFFF
#define SAPD_COLOR 0x3EA3F4FF
#define LSA_COLOR 0xFF0080FF
#define Yellow 0xFFFF00FF
#define yellow 0xFFFF00AA
#define red 0xFF0000AA
#define green 0x45E01FFF
new Name[MAX_PLAYERS];
new pname[MAX_PLAYERS];
new String[MAX_PLAYERS];
new Member[MAX_PLAYERS];//If the player is a Member.
new Leader[MAX_PLAYERS];//If the player is a Leader.
new IsInOrg[MAX_PLAYERS];//If the player is in the org.
new IsLaw[MAX_PLAYERS];//If the org is a law org.
new IsPriv[MAX_PLAYERS];
new IsGang[MAX_PLAYERS];
new OrgId[MAX_PLAYERS];//This is the id of the or that is being requested.
new request[MAX_PLAYERS];//Request
new IsRequesting[MAX_PLAYERS];//If the player is requesting an org.
new file[MAX_PLAYERS];
new FSave[1000];
new SAPD1,SAPD2,SAPD3,SAPD4,SAPD5,SAPD6,SAPD7,SAPD8,SAPD9,SAPD10,SAPD11,SAPD12,SAPD13,SAPD14;
public OnGameModeInit()
{
SAPD1 = AddStaticVehicle(596,1526.1974,-1644.9664,5.6117,179.4196,0,1); //
SAPD2 = AddStaticVehicle(596,1530.2972,-1644.6364,5.6114,183.0269,0,1); //
SAPD3 = AddStaticVehicle(596,1534.7595,-1645.1321,5.6100,182.9272,0,1); //
SAPD4 = AddStaticVehicle(596,1538.2792,-1644.0007,5.6117,180.8078,0,1); //
SAPD5 = AddStaticVehicle(601,1558.2723,-1711.4982,5.6493,357.9770,1,1); //
SAPD6 = AddStaticVehicle(601,1564.1008,-1711.4202,5.6494,359.0573,1,1); //
SAPD7 = AddStaticVehicle(601,1570.6998,-1710.4611,5.6495,359.6237,1,1); //
SAPD8 = AddStaticVehicle(601,1574.5095,-1711.9756,5.6494,0.2955,1,1); //
SAPD9 = AddStaticVehicle(596,1601.1709,-1700.2358,5.6115,88.8725,0,1); //
SAPD10 = AddStaticVehicle(596,1602.2048,-1692.2645,5.6117,89.7542,0,1); //
SAPD11 = AddStaticVehicle(596,1602.3357,-1684.2694,5.6119,90.7812,0,1); //
SAPD12 = AddStaticVehicle(599,1603.2042,-1687.8186,5.9862,90.1683,0,1); //
SAPD13 = AddStaticVehicle(599,1527.3236,-1687.7910,5.9863,269.7841,0,1); //
SAPD14 = AddStaticVehicle(599,1543.7686,-1684.1729,5.9858,93.4536,0,1); //
return 1;
}
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid, Name, sizeof(Name));
format(file,sizeof(file),"OrgUsers/%s.ini", Name);
if(dini_Exists(file))
{
Member[playerid] = dini_Int(file, "Member");
Leader[playerid] = dini_Int(file,"Leader");
IsInOrg[playerid] = dini_Int(file,"Status");
IsLaw[playerid] = dini_Int(file,"Law");
request[playerid] = dini_Int(file,"Request");
IsRequesting[playerid] = dini_Int(file,"Isrequesting");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
GetPlayerName(playerid, Name, sizeof(Name));
format(file,sizeof(file),"OrgUsers/%s.ini", Name);
if(dini_Exists(file))
{
dini_IntSet(file, "Member", Member[playerid]);
dini_IntSet(file, "Leader", Leader[playerid]);
dini_IntSet(file, "Status", IsInOrg[playerid]);
dini_IntSet(file, "Request", request[playerid]);
dini_IntSet(file, "IsRequesting", IsRequesting[playerid]);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
FSave[playerid] = SetTimerEx("Save",1000,true,"i",playerid);//This creates a timer when the player spawns and it saves the file ever 1 second.
if(Member[playerid] == 1)
{
SetPlayerColor(playerid,SAPD_COLOR);
SetPlayerSkin(playerid, 280);
GivePlayerWeapon(playerid,31,5000);
GivePlayerWeapon(playerid,3,-1);
GivePlayerWeapon(playerid,24,500);
SendClientMessage(playerid,White,"Organization: San Andreas Police Departmaent.");
}
if(Member[playerid] == 2)
{
SetPlayerColor(playerid,LSA_COLOR);
SetPlayerSkin(playerid, 287);
GivePlayerWeapon(playerid,22,1000);
GivePlayerWeapon(playerid,32,5000);
SendClientMessage(playerid,White,"Organization: Los Santos Army.");
}
if(Member[playerid] == 3)
{
SetPlayerColor(playerid,LSA_COLOR);
SetPlayerSkin(playerid, 165);
GivePlayerWeapon(playerid,22,1000);
GivePlayerWeapon(playerid,32,5000);
SendClientMessage(playerid,White,"Organization: FBI.");
}
return 1;
}
COMMAND:kickmember(playerid, params[])
{
new id;
if(sscanf(params,"u", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /kickmember [id]");
GetPlayerName(playerid, Name, sizeof(Name));
if(Member[id] == 1 && Leader[playerid] == 1)
{
format(String, sizeof(String), "%s has kicked you from San Andreas Police Dept.",Name);
SendClientMessage(id,0xFF0000FF, String);
SetPlayerColor(id,0xFFFFFFFF);
ResetPlayerWeapons(id);
Leader[id] = 0;
Member[id] = 0;
IsInOrg[id] = 0;
OrgId[id] = 0;
IsLaw[id] = 0;
IsPriv[id] = 0;
IsGang[id] = 0;
IsRequesting[id] = 0;
request[id] = 0;
format(String, sizeof(String), "You have kicked a player from San Andreas Police Dept",Name);
SendClientMessage(playerid,0xFF0000FF, String);
TogglePlayerControllable(id,true);
}
if(Member[id] == 2 && Leader[playerid] == 2)
{
format(String, sizeof(String), "%s has kicked you from Los Santos Army.",Name);
SendClientMessage(id,0xFF0000FF, String);
SetPlayerColor(id,0xFFFFFFFF);
ResetPlayerWeapons(id);
Leader[id] = 0;
Member[id] = 0;
IsInOrg[id] = 0;
OrgId[id] = 0;
IsLaw[id] = 0;
IsPriv[id] = 0;
IsGang[id] = 0;
IsRequesting[id] = 0;
request[id] = 0;
format(String, sizeof(String), "You have kicked a player from Los Santos Army.",Name);
SendClientMessage(playerid,0xFF0000FF, String);
TogglePlayerControllable(id,true);
}
if(Member[id] == 3 && Leader[playerid] == 3)
{
format(String, sizeof(String), "%s has kicked you from FBI.",Name);
SendClientMessage(id,0xFF0000FF, String);
SetPlayerColor(id,0xFFFFFFFF);
ResetPlayerWeapons(id);
Leader[id] = 0;
Member[id] = 0;
IsInOrg[id] = 0;
OrgId[id] = 0;
IsLaw[id] = 0;
IsPriv[id] = 0;
IsGang[id] = 0;
IsRequesting[id] = 0;
request[id] = 0;
format(String, sizeof(String), "You have kicked a player from FBI.",Name);
SendClientMessage(playerid,0xFF0000FF, String);
TogglePlayerControllable(id,true);
}
return 1;
}
COMMAND:accept(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
if(sscanf(params,"u", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /accept [id]");
if(IsInOrg[id] == 1) return SendClientMessage(playerid,red,"This user is already in an organization!");
if(request[id] == 0) return SendClientMessage(playerid,red,"Ths user is not requesting to your organization!");
if(Leader[playerid] == 1 && Member[id] == 0 && request[id] == 1)
{
GetPlayerName(playerid, Name, sizeof(Name));
format(String, sizeof(String), "%s has accepted your application into San Andreas Police Dept.Please type /lawcmds",Name);
SendClientMessage(id,green, String);
Leader[id] = 0;
Member[id] = 1;
IsInOrg[id] = 1;
OrgId[id] = 1;
IsLaw[id] = 1;
IsPriv[id] = 0;
IsGang[id] = 0;
IsRequesting[id] = 0;
request[id] = 0;
SetPlayerSkin(id, 280);
GivePlayerWeapon(id,24,500);
GivePlayerWeapon(id,3,-1);
GivePlayerWeapon(id,31,5000);
SetPlayerColor(id,SAPD_COLOR);
format(String, sizeof(String), "You have set a player member of San Andreas Police Dept.",Name);
SendClientMessage(playerid,green, String);
}
if(IsInOrg[id] == 1) return SendClientMessage(playerid,red,"This user is already in an organization!");
if(request[id] == 0) return SendClientMessage(playerid,red,"Ths user is not requesting to your organization");
if(Leader[playerid] == 2 && Member[id] == 0 && request[id] == 2)
{
format(String, sizeof(String), "%s has accepted your application into Los Santos Army. Please type /orgcmds",Name);
SendClientMessage(id,green, String);
Leader[id] = 0;
Member[id] = 2;
IsInOrg[id] = 1;
OrgId[id] = 2;
IsLaw[id] = 0;
IsPriv[id] = 1;
IsGang[id] = 0;
IsRequesting[id] = 0;
request[id] = 0;
SetPlayerSkin(id, 287);
GivePlayerWeapon(id,22,500);
GivePlayerWeapon(id,32,5000);
SetPlayerColor(id,LSA_COLOR);
format(String, sizeof(String), "You have set a player member of Los Santos Army.",Name);
SendClientMessage(playerid,green, String);
}
if(IsInOrg[id] == 1) return SendClientMessage(playerid,red,"This user is already in an organization!");
if(request[id] == 0) return SendClientMessage(playerid,red,"Ths user is not requesting to your organization");
if(Leader[playerid] == 3 && Member[id] == 0 && request[id] == 3)
{
format(String, sizeof(String), "%s has accepted your application into FBI. Please type /orgcmds",Name);
SendClientMessage(id,green, String);
Leader[id] = 0;
Member[id] = 2;
IsInOrg[id] = 1;
OrgId[id] = 3;
IsLaw[id] = 1;
IsPriv[id] = 0;
IsGang[id] = 0;
IsRequesting[id] = 0;
request[id] = 0;
SetPlayerSkin(id, 165);
GivePlayerWeapon(id,22,500);
GivePlayerWeapon(id,32,5000);
SetPlayerColor(id,LSA_COLOR);
format(String, sizeof(String), "You have set a player member of FBI.",Name);
SendClientMessage(playerid,green, String);
}
return 1;
}
COMMAND:request(playerid, params[])
{
new id;
if(sscanf(params,"i", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /request [orgid]");
GetPlayerName(playerid, Name, sizeof(Name));
if(IsInOrg[playerid] == 1) return SendClientMessage(playerid, red," You are already in a organisation!");
if(IsRequesting[playerid] == 1) return SendClientMessage(playerid, red," You are already requesting to join an organisation!");
if(id == 1)
{
format(String,MAX_PLAYERS,"* %s is requesting to join San Andreas Police Dept.",Name);
SendClientMessageToAll(SAPD_COLOR,String);
IsRequesting[playerid] = 1;
request[playerid] = 1;
return 1;
}
if(id == 2)
{
format(String,MAX_PLAYERS,"* %s is requesting to join Los Santos Army.",Name);
SendClientMessageToAll(LSA_COLOR,String);
IsRequesting[playerid] = 1;
request[playerid] = 2;
return 1;
}
if(id == 3)
{
format(String,MAX_PLAYERS,"* %s is requesting to join FBI.",Name);
SendClientMessageToAll(LSA_COLOR,String);
IsRequesting[playerid] = 1;
request[playerid] = 2;
return 1;
}
return 1;
}
COMMAND:cancelrequest(playerid, params[])
{
if(request[playerid] == 0) return SendClientMessage(playerid,red,"You are not requesting to join any organization!");
GetPlayerName(playerid,pname,sizeof(pname));
if(request[playerid] == 1)
{
format(String,MAX_PLAYERS,"* %s has cancelled his request to join San Andreas Police Department.",pname);
SendClientMessageToAll(0x8F8F8FFF,String);
IsRequesting[playerid] = 0;
request[playerid] = 0;
return 1;
}
if(request[playerid] == 2)
{
format(String,MAX_PLAYERS,"* %s has cancelled his request to join Los Santos Army.",pname);
SendClientMessageToAll(0x8F8F8FFF,String);
IsRequesting[playerid] = 0;
request[playerid] = 0;
return 1;
}
if(request[playerid] == 3)
{
format(String,MAX_PLAYERS,"* %s has cancelled his request to join FBI.",pname);
SendClientMessageToAll(0x8F8F8FFF,String);
IsRequesting[playerid] = 0;
request[playerid] = 0;
return 1;
}
return 1;
}
COMMAND:setleader(playerid, params[])//Set Leader to San Andreas Police Department.
{
new id,oleader;
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,0xDFDFDFFF,"You are not an admin.");
if(sscanf(params,"ui", id,oleader))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /setleader [id] [orgID 1 - 9]");
if(oleader > 9)return SendClientMessage(playerid,red,"Please type /orgids");
if(oleader == 1)
{
GetPlayerName(playerid, Name, sizeof(Name));
format(String, sizeof(String), "%s has set you the leader of San Andreas Police Dept.",Name);
SendClientMessage(id,green, String);
SetPlayerColor(id,SAPD_COLOR);
SetPlayerSkin(id, 282);
GivePlayerWeapon(id,24,500);
GivePlayerWeapon(id,3,-1);
GivePlayerWeapon(id,31,5000);
Leader[id] = 1;
Member[id] = 1;
IsInOrg[id] = 1;
OrgId[id] = 1;
IsLaw[id] = 1;
IsPriv[id] = 0;
IsGang[id] = 0;
IsRequesting[id] = 0;
request[id] = 0;
format(String, sizeof(String), "You have set a new leader for San Andreas Police Dept.",Name);
SendClientMessage(playerid,green, String);
}
if(oleader == 2)
{
GetPlayerName(playerid, Name, sizeof(Name));
format(String, sizeof(String), "%s has set you the leader of Los Santos Army.",Name);
SendClientMessage(id,green, String);
SetPlayerColor(id,LSA_COLOR);
SetPlayerSkin(id, 287);
GivePlayerWeapon(id,22,500);
GivePlayerWeapon(id,32,5000);
Leader[id] = 2;
Member[id] = 2;
IsInOrg[id] = 1;
OrgId[id] = 2;
IsLaw[id] = 1;
IsPriv[id] = 0;
IsGang[id] = 0;
IsRequesting[id] = 0;
request[id] = 0;
format(String, sizeof(String), "You have set a new leader for Los Santos Army.",Name);
SendClientMessage(playerid,green, String);
}
if(oleader == 3)
{
GetPlayerName(playerid, Name, sizeof(Name));
format(String, sizeof(String), "%s has set you the leader of FBI.",Name);
SendClientMessage(id,green, String);
SetPlayerColor(id,LSA_COLOR);
SetPlayerSkin(id, 286);
GivePlayerWeapon(id,22,500);
GivePlayerWeapon(id,32,5000);
Leader[id] = 3;
Member[id] = 3;
IsInOrg[id] = 1;
OrgId[id] = 3;
IsLaw[id] = 1;
IsPriv[id] = 0;
IsGang[id] = 0;
IsRequesting[id] = 0;
request[id] = 0;
format(String, sizeof(String), "You have set a new leader for FBI.",Name);
SendClientMessage(playerid,green, String);
}
return 1;
}
forward Save(playerid);
public Save(playerid)
{
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "OrgUsers/%s",pname);
if(dini_Exists(file))
{
dini_Create(file);
dini_IntSet(file, "Member", Member[playerid]);
dini_IntSet(file, "Leader", Leader[playerid]);
dini_IntSet(file, "Status", IsInOrg[playerid]);
dini_IntSet(file, "Law", IsLaw[playerid]);
dini_IntSet(file, "Gang", IsGang[playerid]);
dini_IntSet(file, "Priv", IsPriv[playerid]);
dini_IntSet(file, "Request", request[playerid]);
dini_IntSet(file, "IsRequesting", IsRequesting[playerid]);
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == SAPD1 && Member[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is an Organization vehicle!");
}
}
if(newstate == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == SAPD2 && Member[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is an Organization vehicle!");
}
}
if(newstate == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == SAPD3 && Member[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is an Organization vehicle!");
}
}
if(newstate == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == SAPD4 && Member[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is an Organization vehicle!");
}
}
if(newstate == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == SAPD5 && Member[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is an Organization vehicle!");
}
} if(newstate == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == SAPD6 && Member[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is an Organization vehicle!");
}
} if(newstate == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == SAPD7 && Member[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is an Organization vehicle!");
}
} if(newstate == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == SAPD8 && Member[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is an Organization vehicle!");
}
}
if(newstate == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == SAPD9 && Member[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is an Organization vehicle!");
}
} if(newstate == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == SAPD10 && Member[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is an Organization vehicle!");
}
} if(newstate == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == SAPD11 && Member[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is an Organization vehicle!");
}
} if(newstate == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == SAPD12 && Member[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is an Organization vehicle!");
}
} if(newstate == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == SAPD13 && Member[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is an Organization vehicle!");
}
} if(newstate == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == SAPD14 && Member[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is an Organization vehicle!");
}
}
return 1;
}
right, marwan i am sorry i did not corrected ur error due to i turn off meh pc.
And now i replied frm mobile |