organisation script help
#1

ok i have a organisation in my game mode and i want to make a other 1 but i made it into a filter script but when the menu shows up it overides the 1 in my gamemode

Код:
// Chromes Org Filter script
#define FilterScript

#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 // - LIME FTW
#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 //<--- Dark lime
#define COLOR_MIDNIGHTBLUE 0X191970AA
#define COLOR_MAROON 0x800000AA
#define COLOR_OLIVE 0x808000AA
#define COLOR_ORANGERED 0xFF4500AA
#define COLOR_PINK 0xFFC0CBAA // - Light light pink
#define COLOR_SPRINGGREEN 0x00FF7FAA
#define COLOR_TOMATO 0xFF6347AA // - Tomato >:/ sounds wrong lol... well... :P
#define COLOR_YELLOWGREEN 0x9ACD32AA //- like military green
#define COLOR_MEDIUMAQUA 0x83BFBFAA
#define COLOR_MEDIUMMAGENTA 0x8B008BAA // dark magenta ^^

new SAPD1,SAPD2,SAPD3,SAPD4,SAPD5,SAPD6,SAPD7;
new ID,org,str[128],SaveTimer[MAX_PLAYERS],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 FSave[500];
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("Chromes Gamemode");
	SAPD1 = AddStaticVehicle(598,2268.9956,2443.0542,10.5667,359.8453,0,1); 
    SAPD2 = AddStaticVehicle(598,2277.5515,2442.9817,10.5664,359.4151,0,1); 
    SAPD3 = AddStaticVehicle(598,2269.0803,2459.4700,10.5694,0.3663,0,1); 
    SAPD4 = AddStaticVehicle(598,2277.6169,2459.9805,10.5669,358.3371,0,1); 
    SAPD5 = AddStaticVehicle(523,2273.2134,2442.9973,10.3903,358.3285,0,0);
    SAPD6 = AddStaticVehicle(523,2273.4133,2459.6526,10.3903,0.2938,0,0);
    SAPD7 = AddStaticVehicle(497,2312.6777,2445.1099,10.9965,184.6313,0,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),"ServerChromesFreeRoam/%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,0x0968F7FF);
		GivePlayerWeapon(ID,29,5000);
		GivePlayerWeapon(ID,32,5000);
		GivePlayerWeapon(ID,24,500);
	}
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	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 == SAPD1 && PlayerData[playerid][Member] !=1)
		{
			RemovePlayerFromVehicle(playerid);
			SendClientMessage(playerid, red, "This Belongs To The Sanandreas Police Department!");
		}
	}
	if(newstate == PLAYER_STATE_DRIVER)
	{
		new vid = GetPlayerVehicleID(playerid);
		if((vid == SAPD2) && (PlayerData[playerid][Member] != 1))
		{
			RemovePlayerFromVehicle(playerid);
			SendClientMessage(playerid, red, "This Belongs To The Sanandreas Police Department!");
		}
	}
	if(newstate == PLAYER_STATE_DRIVER)
	{
		new vid = GetPlayerVehicleID(playerid);
		if((vid == SAPD3) && (PlayerData[playerid][Member] != 1))
		{
			RemovePlayerFromVehicle(playerid);
			SendClientMessage(playerid, red, "This Belongs To The Sanandreas Police Department!");
		}
	}
	if(newstate == PLAYER_STATE_DRIVER)
	{
		new vid = GetPlayerVehicleID(playerid);
		if((vid == SAPD4) && (PlayerData[playerid][Member] != 1))
		{
			RemovePlayerFromVehicle(playerid);
			SendClientMessage(playerid, red, "This Belongs To The Sanandreas Police Department!");
		}
	}
	if(newstate == PLAYER_STATE_DRIVER)
	{
		new vid = GetPlayerVehicleID(playerid);
		if((vid == SAPD5) && (PlayerData[playerid][Member] != 1))
		{
			RemovePlayerFromVehicle(playerid);
			SendClientMessage(playerid, red, "This Belongs To The Sanandreas Police Department!");
		}
	}
	if(newstate == PLAYER_STATE_DRIVER)
	{
		new vid = GetPlayerVehicleID(playerid);
		if((vid == SAPD6) && (PlayerData[playerid][Member] != 1))
		{
			RemovePlayerFromVehicle(playerid);
			SendClientMessage(playerid, red, "This Belongs To The Sanandreas Police Department!");
		}
	}
	if(newstate == PLAYER_STATE_DRIVER)
	{
		new vid = GetPlayerVehicleID(playerid);
		if((vid == SAPD7) && (PlayerData[playerid][Member] != 1))
		{
			RemovePlayerFromVehicle(playerid);
			SendClientMessage(playerid, red, "This Belongs To The Sanandreas Police Department!");
		}
	}
	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 == 2)
	{
	format(str,sizeof(str),"Administrator %s has set you the leader of The San Andres Police Department, use /lawcmds for commands",Nam);
	SendClientMessage(ID,orange,str);
	format(str,sizeof(str),"You have set %s the The San Andres Police Department",pname);
	SendClientMessage(playerid,orange,str);
	SetPlayerColor(ID,0x1B5E23FF);
	SetPlayerSkin(playerid, 282);
	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] == 2) 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,"Organisations","The San Andres Police Department","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 for The San Andres Police Department",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 The San Andres Police Department!",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 The San Andres Police Department, use /lawcmds for commands",Nam);
	    SendClientMessage(ID,orange,str);
		format(str,sizeof(str),"You have accepted %s into The San Andres Police Department",pname);
		SendClientMessage(playerid,orange,str);
		SetPlayerColor(ID,0x0968F7FF);
		SetPlayerSkin(playerid, 280);
	    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:Coleadercmds(playerid,params[])
{
	if(PlayerData[playerid][Leader] == 1)
	{
	    SendClientMessage(playerid,-1,"CoLEADER CMDS: /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,"The San Andres Police Department || 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]++;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)