Код:
#include <a_samp>
#define TEAM_GREEN 1
#define TEAM_BLUE 2
#define TEAM_PURPLE 3
#define TEAM_YELLOW 4
#define TEAM_GREEN_COLOUR 0x33AA33AA
#define TEAM_BLUE_COLOUR 0x0000BBAA
#define TEAM_PURPLE_COLOUR 0x990099AA
#define TEAM_YELLOW_COLOUR 0xFFE500AA
new gTeam[MAX_PLAYERS];
new Enter;
new Exit;
forward PlayerToPoint(Float:radi,playerid,Float:x,Float:y,Float:z);
main()
{
print("\n----------------------------------");
print(" Los Santos Gang War v1.3");
print(" By: Emanuel Rodriguez");
print("----------------------------------\n");
}
public OnGameModeInit()
{
SetGameModeText("Gang War v1.3");
SetTeamCount(4);
DisableInteriorEnterExits();
//player classes
AddPlayerClass(0,2497.4426,-1680.9385,13.3550,64.8240,0,0,0,0,0,0); //0
AddPlayerClass(105,2497.4426,-1680.9385,13.3550,64.8240,0,0,0,0,0,0); //1
AddPlayerClass(106,2497.4426,-1680.9385,13.3550,64.8240,0,0,0,0,0,0); //2
AddPlayerClass(107,2497.4426,-1680.9385,13.3550,64.8240,0,0,0,0,0,0); //3
AddPlayerClass(280,1544.6689,-1675.7109,13.5589,86.6347,0,0,0,0,0,0); //4
AddPlayerClass(102,2169.2446,-1673.6566,15.0859,258.6506,0,0,0,0,0,0); //5
AddPlayerClass(103,2169.2446,-1673.6566,15.0859,258.6506,0,0,0,0,0,0); //6
AddPlayerClass(104,2169.2446,-1673.6566,15.0859,258.6506,0,0,0,0,0,0); //7
AddPlayerClass(108,2584.0645,-1237.8757,48.4207,89.8074,0,0,0,0,0,0); //8
AddPlayerClass(109,2584.0645,-1237.8757,48.4207,89.8074,0,0,0,0,0,0); //9
AddPlayerClass(110,2584.0645,-1237.8757,48.4207,89.8074,0,0,0,0,0,0); //10
//vehicles
AddStaticVehicle(492,2508.3020,-1666.4688,13.1826,10.9471,16,11); //greenwood - grove street
AddStaticVehicle(492,2492.2197,-1655.7086,13.1491,89.6856,16,11); //greenwood - grove street
AddStaticVehicle(536,2574.9692,-1239.0798,47.3366,359.3618,6,8); //blade - los santos vagos
AddStaticVehicle(492,2175.3677,-1676.4098,14.7059,321.0523,22,11); //greenwood - ballas
AddStaticVehicle(596,1536.2356,-1672.3240,13.1647,181.7783,0,1); //LS cop car - cops
AddStaticVehicle(596,1552.8773,-1606.7004,13.2028, 216,-1,-1); //LS cop car - cops
AddStaticVehicle(596,1556.6258,-1606.5765,13.2028, 216,-1,-1); //LS cop car - cops
AddStaticVehicle(596,1560.3270,-1606.6180,13.2028, 216,-1,-1); //LS cop car - cops
AddStaticVehicle(596,1600.8968,-1683.9887,5.7106,90,-1,-1); //LS cop car - cops
AddStaticVehicle(427,1600.5671,-1688.0106,6.1386,90,-1,-1); //Enforcer - cops
AddStaticVehicle(599,1600.5218,-1700.1855,6.2757,270,-1,-1); //Police Rancher - cops
AddStaticVehicle(596,1601.0782,-1696.1751,5.7106,90,-1,-1); //LS cop car - cops
//pickups
Enter = CreatePickup(1239,23,1554.5319,-1675.3055,16.1953);
Exit = CreatePickup(1239,23,1494.1222,1304.9009,1093.2891);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid,2466.3333,-1656.4086,13.2896);
SetPlayerCameraPos(playerid,2471.9265,-1657.6971,13.3393);
SetPlayerCameraLookAt(playerid,2466.3333,-1656.4086,13.2896);
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColour(playerid);
return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 0)
{
gTeam[playerid] = TEAM_GREEN;
}
else if(classid == 1)
{
gTeam[playerid] = TEAM_GREEN;
}
else if(classid == 2)
{
gTeam[playerid] = TEAM_GREEN;
}
else if(classid == 3)
{
gTeam[playerid] = TEAM_GREEN;
}
else if(classid == 4)
{
gTeam[playerid] = TEAM_BLUE;
}
else if(classid == 5)
{
gTeam[playerid] = TEAM_PURPLE;
}
else if(classid == 6)
{
gTeam[playerid] = TEAM_PURPLE;
}
else if(classid == 7)
{
gTeam[playerid] = TEAM_PURPLE;
}
else if(classid == 8)
{
gTeam[playerid] = TEAM_YELLOW;
}
else if(classid == 9)
{
gTeam[playerid] = TEAM_YELLOW;
}
else if(classid == 10)
{
gTeam[playerid] = TEAM_YELLOW;
}
}
SetPlayerToTeamColour(playerid)
{
if(gTeam[playerid] == TEAM_GREEN)
{
SetPlayerColor(playerid,TEAM_GREEN_COLOUR); // Blue
}
else if(gTeam[playerid] == TEAM_BLUE)
{
SetPlayerColor(playerid,TEAM_BLUE_COLOUR); // Green
}
else if(gTeam[playerid] == TEAM_PURPLE)
{
SetPlayerColor(playerid,TEAM_PURPLE_COLOUR); // Purple
}
else if(gTeam[playerid] == TEAM_YELLOW)
{
SetPlayerColor(playerid,TEAM_YELLOW_COLOUR); //Yellow
}
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/enter", cmdtext, true) == 0)
{
if(PlayerToPoint(3.0, playerid, 1554.5319,-1675.3055,16.1953))
{
GameTextForPlayer(playerid, "~w~POLICE DEPARTMENT", 3500, 3);
SetPlayerInterior(playerid,6);
SetPlayerPos(playerid,246.783996,63.900199,1003.640625);
return 1;
}
return 1;
}
if (strcmp("/exit", cmdtext, true) == 0)
{
if(PlayerToPoint(3.0, playerid,1494.1222, 1304.9009, 1093.2891))
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid, 1554.5319,-1675.3055,16.1953);
return 1;
}
return 1;
}
return 0;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == Enter)
{
GameTextForPlayer(playerid,"~y~ Welcome ~r~ The ~p~ Employee ~y~Lounge ~n~~n~ ~w~type: /enter to get inside", 5000, 5);
}
if(pickupid == Exit)
{
GameTextForPlayer(playerid, "~y~ To ~r~ Leave ~p~ The ~y~ Employee ~y~ Lounge ~n~~n~ ~w~type: /exit to go outside", 5000, 5);
}
return 1;
}
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposx = (oldposx -y);
tempposx = (oldposx -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
return 0;
}
ok NEVER MIND EVERYONE! total mistake I did not see it. I had put this: