Yellow Markers
#1

is Possible to Remove YELLOW MARKERS to entering buildings ? and make checkpoints for that and how i can do that ?
Reply
#2

pawn Код:
DisableInteriorEnterExits();
Add to OnGameModeInit.
Reply
#3

It is very possible.

https://sampwiki.blast.hk/wiki/DisableInteriorEnterExits

and use:

Quote:

1559 - small yellow cone for person

To make your own yellow marker.

https://sampwiki.blast.hk/wiki/Model_ID
Reply
#4

ok it works great but tell me

why when i leave a car this checkpoint is disabled '' in my gamemode is at LVPD''

and how i can make player see checkpoint just if he is near it...

here is my gamemode

http://pastebin.com/d6612f804

or:

Код:
//---------------------------------------------------------------------------------------------------------------------------------------//
// GAMEMODE: REALITY COPS / ROBBERS / ROLEPLAY MADED BY ---> Kljukec                                   //
//                                                                    //
//                                                                    //
// SPECIAL THANKS TO PPL WHO HELP ME :                                                  //
// - WeedSmoker                                    GO EAST                  GO WEST //
// - Warmachine                                                             //
//                                                                    //
// AND TO GUYS WHO MADE THIS GOOD FORUM : www.sa-mp.com/forum                     KLJUKEC IS THE WORST XD      //
// AND PPL WHO ARE ON THIS FORUM                                                     //
//                                                                    //
//            DONT       DELETE        NOTHING      HERE    !!!                   //
//---------------------------------------------------------------------------------------------------------------------------------------//

#include <a_samp>
#include <core>
#include <float>
#include <ranks>

// COLORS

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_BRIGHTRED 0xFF0000AA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_VIOLET 0x9955DEEE
#define COLOR_LIGHTRED 0xFF99AADD
#define COLOR_SEAGREEN 0x00EEADDF
#define COLOR_GRAYWHITE 0xEEEEFFC4
#define COLOR_LIGHTNEUTRALBLUE 0xabcdef66
#define COLOR_GREENISHGOLD 0xCCFFDD56
#define COLOR_LIGHTBLUEGREEN 0x0FFDD349
#define COLOR_NEUTRALBLUE 0xABCDEF01
#define COLOR_LIGHTCYAN 0xAAFFCC33
#define COLOR_LEMON 0xDDDD2357
#define COLOR_MEDIUMBLUE 0x63AFF00A
#define COLOR_NEUTRAL 0xABCDEF97
#define COLOR_BLACK 0x00000000
#define COLOR_NEUTRALGREEN 0x81CFAB00
#define COLOR_DARKGREEN 0x12900BBF
#define COLOR_LIGHTGREEN 0x24FF0AB9
#define COLOR_DARKBLUE 0x300FFAAB
#define COLOR_BLUEGREEN 0x46BBAA00
#define COLOR_PINK 0xFF66FFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PURPLE 0x800080AA
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_RED1 0xFF0000AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BROWN 0x993300AA
#define COLOR_CYAN 0x99FFFFAA
#define COLOR_TAN 0xFFFFCCAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_KHAKI 0x999900AA
#define COLOR_LIME 0x99FF00AA
#define COLOR_SYSTEM 0xEFEFF7AA
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD1 0xB4B5B7FF

//TEAMS

#define TEAM_COP 0
#define TEAM_COP_COLOR 0x0000BBAA
#define TEAM_FBI 1
#define TEAM_FBI_COLOR 0x0000BBAA

new gTeam[MAX_PLAYERS];
new Menu:Weaponmenu;
new Pickup;

forward SetPlayerRandomSpawn(playerid);
forward OnPlayerPickupPickup(playerid, pickupid);
forward SetPlayerToTeamColor(playerid);
forward SetPlayerTeamFromClass(playerid,classid);
//-----------------------------------------------------------------------------------------------------------------------------------------

//RANDOM SPAWNS

new Float:gRandomPlayerSpawns[25][3] = {
{2628.8330,2348.0713,10.8203},
{2861.6289,2430.3257,11.0690},
{2810.8657,1987.2445,10.8203},
{2671.0632,2011.1609,10.8281},
{2624.4458,1824.3765,11.0234},
{2495.6506,1643.8921,14.2656},
{2482.3540,1526.6769,11.4562},
{2614.2900,1385.7592,10.8203},
{2535.3647,997.6971,14.2725},
{2485.9419,919.0803,10.8203},
{1898.0858,684.8121,14.2752},
{1549.4457,1017.5471,10.8203},
{1876.0280,2236.2859,11.1250},
{1909.2520,2350.3167,10.9799},
{2118.0330,2416.6912,49.5234},
{2126.8560,2360.9534,10.8203},
{1417.5988,2235.8542,11.0234},
{1044.5269,1013.0023,11.0000},
{-70.1027,1211.2644,22.4403},
{14.1694,1189.5394,19.3101},
{-248.7177,2591.8750,63.5703},
{-844.5303,2744.8708,45.8474},
{-1483.3262,2646.6748,58.7281},
{-746.7950,1589.8105,26.9609},
{-688.0734,946.6996,13.0313}
};


//-----------------------------------------------------------------------------------------------------------------------------------------

main()
{
		print("\n----------------------------------");
		print(" Reality Cops / Robbers / Roleplay\n");
		print("     Maded By");
		print("     Kljukec");
		print("----------------------------------\n");
}


// GAMEMODE

public OnGameModeInit()
{
	SetGameModeText("Reality Cops / Robbers / Roleplay");

	//SKINS / CARS AND OTHER THINGS

	// COP SKINS
	AddPlayerClassEx(1,280,1499.2468,-868.0775,61.5520,37.2653,0,0,0,0,0,0); // cop USE ADDPLAYERCLASSEX!!!!! not this 0-8-15-teamshit!
	AddPlayerClassEx(1,281,1499.2468,-868.0775,61.5520,37.2653,0,0,0,0,0,0); // cop
	AddPlayerClassEx(1,282,1499.2468,-868.0775,61.5520,37.2653,0,0,0,0,0,0); // cop
	AddPlayerClassEx(1,283,1499.2468,-868.0775,61.5520,37.2653,0,0,0,0,0,0); // cop
	AddPlayerClassEx(1,284,1499.2468,-868.0775,61.5520,37.2653,0,0,0,0,0,0); // cop
	AddPlayerClassEx(1,285,1499.2468,-868.0775,61.5520,37.2653,0,0,0,0,0,0); // cop
	AddPlayerClassEx(1,288,1499.2468,-868.0775,61.5520,37.2653,0,0,0,0,0,0); // cop
	AddPlayerClassEx(2,163,1499.2468,-868.0775,61.5520,37.2653,0,0,0,0,0,0); // fbi
	AddPlayerClassEx(2,164,1499.2468,-868.0775,61.5520,37.2653,0,0,0,0,0,0); // fbi
	AddPlayerClassEx(2,165,1499.2468,-868.0775,61.5520,37.2653,0,0,0,0,0,0); // fbi
	AddPlayerClassEx(2,166,1499.2468,-868.0775,61.5520,37.2653,0,0,0,0,0,0); // fbi
	AddPlayerClassEx(2,286,1499.2468,-868.0775,61.5520,37.2653,0,0,0,0,0,0); // fbi
	
	//OTHER
	
	AllowInteriorWeapons(1);
	DisableInteriorEnterExits();


	//RANKS

	SetPromotionMode(0-5);

	AddRank(0, "BEGINER!", 0, 1000, 100.0, 0, 0, 0);
	AddRank(1, "YOU ARE GOOD!", 3, 3000, 100.0, 25.0, 24, 50);
	AddRank(2, "PROFFESSIONAL!", 10, 4000, 100.0, 50.0, 25, 100);
	AddRank(3, "THE BEST!", 15, 5000, 100.0, 60.0, 27, 250);
	AddRank(4, "GOD LIKE!", 20, 7000, 100.0, 70.0, 36, 300);

	//MENU
	
	//PICKUPS
	
	AddStaticPickup(1242, 23, 2491.7900, -1668.1653, 13.3438);

	//CARS

	//PLANES

	//HELIS

	AddStaticVehicle(497,1358.8999,1267.3306,10.9971,358.8091,0,1); // police heli


	return 1;
}

//-----------------------------------------------------------------------------------------------------------------------------------------

//RANDOM SPAWNS AND OTHER THINGS

public OnPlayerSpawn(playerid)
{
  SetPlayerCheckpoint(playerid, 2336.9990,2458.2141,14.9688,3.0); //LVPD ENTRANCE
  SetPlayerCheckpoint(playerid, 2287.1086,2431.5913,10.8203,3.0); //LVPD ENTRANCE
  
  SetPlayerRandomSpawn(playerid);
  SetPlayerInterior(playerid,0);
  S_OnPlayerSpawn(playerid);
  GivePlayerMoney(playerid, 10000);
  SetPlayerToTeamColor(playerid);
  return 1;
}

public SetPlayerRandomSpawn(playerid)

{
  new rand;
  rand = random(sizeof(gRandomPlayerSpawns));
  SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]);

  return 1;

}

//-----------------------------------------------------------------------------------------------------------------------------------------

//CAMERA IN CLASS SELECTION

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 487.1171,-2.7114,1002.3828);
	SetPlayerFacingAngle(playerid, 179.3733);
	SetPlayerInterior(playerid, 17); // DANCE CLUB IN IDLEWOOD
	SetPlayerCameraPos(playerid, 487.3722,-5.0637,1002.0781);
	SetPlayerCameraLookAt(playerid, 487.1171,-2.7114,1002.3828);

//-----------------------------------------------------------------------------------------------------------------------------------------

	if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 5 || classid == 6){
		GameTextForPlayer(playerid,"~b~COP ~w~TEAM",1000,5);
	} else if(classid == 7 || classid == 8 || classid == 9 || classid == 10 || classid == 11) {
	  GameTextForPlayer(playerid,"~b~FBI ~w~TEAM",1000,5);
	}
	return 1;
}

//-----------------------------------------------------------------------------------------------------------------------------------------

// CONNECT

public OnPlayerConnect(playerid)
{
  Pickup = CreatePickup(1239, 1, 1495.6089,-862.7116,61.5786);
  GameTextForPlayer(playerid,"~r~Welcome ~w~ To ~b~ Reality Cops / Robbers / Roleplay Server ~r~ HAVE FUN! ",3000,5);
	SendClientMessage(playerid, 0x33CCFFAA,"Welcome To Reality Cops / Robbers / Roleplay Server Beta 1.0");
	SendClientMessage(playerid, 0xFF66FFAA,"This is not Deathmach server ! Fallow the rules !");
	SendClientMessage(playerid, 0x33AA33AA,"Read /rules /cmds and Have Fun");
	S_OnPlayerConnect(playerid);
	SetPlayerRandomSpawn(playerid);

 	new pName[MAX_PLAYER_NAME];
  new string[48];
  GetPlayerName(playerid, pName, sizeof(pName));
  format(string, sizeof(string), "%s has joined the server.", pName);
  SendClientMessageToAll(0xAAAAAAAA, string);

	return 1;
}

//COMMANDS

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/rules", cmdtext, true, 10) == 0)
	{
	SendClientMessage(playerid,0x33AA33AA,"=======================================Rules=================================");
	SendClientMessage(playerid,0x24FF0AB9,"1.) This is NOT a DM server - NO RANDOM KILLING");
	SendClientMessage(playerid,0x24FF0AB9,"2.) Respect Other Players - No Bitching, Insulting");
	SendClientMessage(playerid,0x24FF0AB9,"3.) Respect Admins - No Bitching, instulting");
	SendClientMessage(playerid,0x24FF0AB9,"4.) DONT ADVERTISE Other Server IP's");
	SendClientMessage(playerid,0x24FF0AB9,"5.) DONT ask Admins if you can be Admin, If we need you we will ask you !");
	SendClientMessage(playerid,0x24FF0AB9,"6.) DONT HACK or you will be BANNED");
	SendClientMessage(playerid,0x24FF0AB9,"7.) DONT BITCHING in CHAT or you will be KICKED / BANNED");
	SendClientMessage(playerid,0x33AA33AA,"==HAVE=====FUN=====WITH=====PLAYING=====REALITY=====COPS==ROBBERS==ROLEPLAY==");
	return 1;
}

//-------------------------LOCK COMMAND----------------------------------------------------------------------------------------------------
  if (strcmp(cmdtext, "/lock", true)==0)
		{
			if(IsPlayerInAnyVehicle(playerid))
			{
				new State=GetPlayerState(playerid);
				if(State!=PLAYER_STATE_DRIVER)
				{
					SendClientMessage(playerid,0xAA3333AA,"You can only lock the doors as the driver.");
					return 1;
				}
				new i;
				for(i=0;i<MAX_PLAYERS;i++)
				{
					if(i != playerid)
					{
						SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
					}
				}
				SendClientMessage(playerid, 0xFFFF00AA, "Vehicle locked!");
		  	new Float:pX, Float:pY, Float:pZ;
				GetPlayerPos(playerid,pX,pY,pZ);
				PlayerPlaySound(playerid,1056,pX,pY,pZ);
			}
			else
			{
				SendClientMessage(playerid, 0xAA3333AA, "You're not in a vehicle!");
			}
			return 1;
		}

//------------------------UNLOCK COMMAND---------------------------------------------------------------------------------------------------
	if (strcmp(cmdtext, "/unlock", true)==0)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			new State=GetPlayerState(playerid);
			if(State!=PLAYER_STATE_DRIVER)
			{
				SendClientMessage(playerid,0xAA3333AA,"You can only unlock the doors as the driver.");
				return 1;
			}
			new i;
			for(i=0;i<MAX_PLAYERS;i++)
			{
				SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
			}
			SendClientMessage(playerid, 0xFFFF00AA, "Vehicle unlocked!");
			new Float:pX, Float:pY, Float:pZ;
			GetPlayerPos(playerid,pX,pY,pZ);
			PlayerPlaySound(playerid,1057,pX,pY,pZ);
		}
		else
		{
			SendClientMessage(playerid, 0xAA3333AA, "You're not in a vehicle!");
		}
		return 1;
	}
	return 0;
}


//-----------------------------------------------------------------------------------------------------------------------------------------

//-----------------------------------------------------------------------------------------------------------------------------------------

//-----------------------------------------------------------------------------------------------------------------------------------------

//DEADS

public OnPlayerDeath(playerid, killerid, reason)
{
	SendDeathMessage(killerid, playerid, reason);
  S_OnPlayerDeath(killerid);
	return 1;
}


//-----------------------------------------------------------------------------------------------------------------------------------------

//DISCONNECT

public OnPlayerDisconnect(playerid, reason)
{
  new pName[MAX_PLAYER_NAME], string[56];
  GetPlayerName(playerid, pName, sizeof(pName));
  switch(reason)
  {
    case 0: format(string, sizeof(string), "%s has left the server. (Connection Lost)", pName);
    case 1: format(string, sizeof(string), "%s has left the server. (Quit)", pName);
    case 2: format(string, sizeof(string), "%s has left the server. (Kicked)", pName);
  }
  SendClientMessageToAll(0xAAAAAAAA, string);
  return 1;
}

//-----------------------------------------------------------------------------------------------------------------------------------------

public OnPlayerEnterCheckpoint(playerid)
{
	SetPlayerPos(playerid, 238.6620,141.0520,1003.0234);
	SetPlayerInterior(playerid, 3);
	SendClientMessage(playerid, 0x33CCFFAA, "Welcome To LVPD");
}
//-----------------------------------------------------------------------------------------------------------------------------------------

//TEAMS

public SetPlayerTeamFromClass(playerid,classid)
{
	if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 5 || classid == 6){
		gTeam[playerid] = TEAM_COP;
	} else if(classid == 7 || classid == 8 || classid == 9 || classid == 10 || classid == 11){
	  gTeam[playerid] = TEAM_FBI;
	}
}

//-----------------------------------------------------------------------------------------------------------------------------------------

public SetPlayerToTeamColor(playerid)
{
	if(gTeam[playerid] == TEAM_COP) {
		SetPlayerColor(playerid,TEAM_COP_COLOR); // BLUE
	} else if(gTeam[playerid] == TEAM_FBI) {
	  SetPlayerColor(playerid,TEAM_FBI_COLOR); // BLUE
	}
}

//--------------------------------------------------------------------------------

public OnPlayerPickupPickup(playerid, pickupid)
{
  ShowMenuForPlayer(Weaponmenu, playerid);
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  new string[128];
  format(string, sizeof(string), "INFO: You're entering vehicle",vehicleid);
  SendClientMessage(playerid, 0xFFFF00AA, string);
  return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
  new string[128];
  format(string, sizeof(string), "INFO: You have exited vehicle", vehicleid);
  SendClientMessage(playerid, 0xFFFF00AA, string);
  return 1;
}
help pelase

ty
Reply
#5

Use PlayerToPoint.

pawn Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
pawn Код:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
  if(IsPlayerConnected(playerid))
    {
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        tempposx = (oldposx -x);
        tempposy = (oldposy -y);
        tempposz = (oldposz -z);
        //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {
            return 1;
        }
    }
    return 0;
}
Reply
#6

Quote:
Originally Posted by Gergo1352
Use PlayerToPoint.

pawn Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
pawn Код:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
  if(IsPlayerConnected(playerid))
    {
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        tempposx = (oldposx -x);
        tempposy = (oldposy -y);
        tempposz = (oldposz -z);
        //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {
            return 1;
        }
    }
    return 0;
}
hmm here still my checkpoint disable when i exit from car ... nad i still see it on map if i am 1000 miles away drom it
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)