[Help] If wanted = no teleport
#1

Код:
public CheckForWalkingTeleport(playerid) // only put teleports ON FOOT here, use another function for vehicle ones - luk0r
{
	/*
	 *  HOW TO USE THIS FUNCTION:
	 *
	 *  Just use your normal PlayerToPoint functions but make them use PlayerToPointStripped instead.
	 *  Use the arguments cx,cy,cz at the end of each call (look at the others for an example).
	 *
	 */
	new Float:cx, Float:cy, Float:cz;
	GetPlayerPos(playerid, cx, cy, cz);

	if(PlayerToPointStripped(1, playerid,1554.9537,-1675.6584,16.1953, cx,cy,cz))
	{//LSPD Entrance
		GameTextForPlayer(playerid, "~w~Police Department", 5000, 1);
		SetPlayerInterior(playerid, 6);
		SetPlayerPos(playerid,246.7079,66.2239,1003.6406);
		PlayerInfo[playerid][pInt] = 6;
	}
	else if(PlayerToPointStripped(1, playerid,246.5325,62.4251,1003.6406, cx,cy,cz))
	{//LSPD Exit
		GameTextForPlayer(playerid, "~w~Los Santos", 5000, 1);
		SetPlayerInterior(playerid, 0);
		SetPlayerPos(playerid,1552.3231,-1674.6780,16.1953);
		PlayerInfo[playerid][pInt] = 0;
	}
	else if (PlayerToPointStripped(1, playerid,1481.0206,-1771.1138,18.7958, cx,cy,cz))
	{
		//City hall
		SetPlayerPos(playerid, 386.2978,173.8582,1008.3828);
		GameTextForPlayer(playerid, "~w~City Hall",5000,1);
		SetPlayerInterior(playerid,3);
		SetPlayerFacingAngle(playerid, 0);
		PlayerInfo[playerid][pInt] = 3;
	}
	else if (PlayerToPointStripped(1, playerid,390.0630,173.5741,1008.3828, cx,cy,cz))
	{
		//City hall
		SetPlayerPos(playerid, 1481.0206,-1769.5138,18.7958);
		GameTextForPlayer(playerid, "~w~Los Santos",5000,1);
		SetPlayerInterior(playerid,0);
		SetPlayerFacingAngle(playerid, 0);
		PlayerInfo[playerid][pInt] = 0;
	}
	return 1;
}
How can i make that if someone is (if(playerid == gWanted) that he didn't should get teleported...
Reply
#2

put (if(playerid != gWanted) on all teleport
Reply
#3

Код:
public CheckForWalkingTeleport(playerid) // only put teleports ON FOOT here, use another function for vehicle ones - luk0r
{
	/*
	 *  HOW TO USE THIS FUNCTION:
	 *
	 *  Just use your normal PlayerToPoint functions but make them use PlayerToPointStripped instead.
	 *  Use the arguments cx,cy,cz at the end of each call (look at the others for an example).
	 *
	 */
        if(playerid == gWanted) return 1;       //ADDED HERE
	new Float:cx, Float:cy, Float:cz;
	GetPlayerPos(playerid, cx, cy, cz);

	if(PlayerToPointStripped(1, playerid,1554.9537,-1675.6584,16.1953, cx,cy,cz))
	{//LSPD Entrance
		GameTextForPlayer(playerid, "~w~Police Department", 5000, 1);
		SetPlayerInterior(playerid, 6);
		SetPlayerPos(playerid,246.7079,66.2239,1003.6406);
		PlayerInfo[playerid][pInt] = 6;
	}
	else if(PlayerToPointStripped(1, playerid,246.5325,62.4251,1003.6406, cx,cy,cz))
	{//LSPD Exit
		GameTextForPlayer(playerid, "~w~Los Santos", 5000, 1);
		SetPlayerInterior(playerid, 0);
		SetPlayerPos(playerid,1552.3231,-1674.6780,16.1953);
		PlayerInfo[playerid][pInt] = 0;
	}
	else if (PlayerToPointStripped(1, playerid,1481.0206,-1771.1138,18.7958, cx,cy,cz))
	{
		//City hall
		SetPlayerPos(playerid, 386.2978,173.8582,1008.3828);
		GameTextForPlayer(playerid, "~w~City Hall",5000,1);
		SetPlayerInterior(playerid,3);
		SetPlayerFacingAngle(playerid, 0);
		PlayerInfo[playerid][pInt] = 3;
	}
	else if (PlayerToPointStripped(1, playerid,390.0630,173.5741,1008.3828, cx,cy,cz))
	{
		//City hall
		SetPlayerPos(playerid, 1481.0206,-1769.5138,18.7958);
		GameTextForPlayer(playerid, "~w~Los Santos",5000,1);
		SetPlayerInterior(playerid,0);
		SetPlayerFacingAngle(playerid, 0);
		PlayerInfo[playerid][pInt] = 0;
	}
	return 1;
}
just check for it on the top... if player = gWanted then the script stops checking.
Reply
#4

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)