SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 12/01/2011, 03:18 PM   #1
Jimbo01
Big Clucker
 
Join Date: Jul 2010
Posts: 154
Reputation: 1
Default [Help] If wanted = no teleport

Code:
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...
Jimbo01 is offline  
Old 12/01/2011, 03:22 PM   #2
Vukilore
Huge Clucker
 
Vukilore's Avatar
 
Join Date: Jan 2011
Location: http://forum.sa-mp-fr.com/index.php
Posts: 300
Reputation: 110
Default Re : [Help] If wanted = no teleport

put (if(playerid != gWanted) on all teleport
Vukilore is offline  
Old 12/01/2011, 03:22 PM   #3
Sascha
High-roller
 
Sascha's Avatar
 
Join Date: Jul 2009
Location: Germany
Posts: 1,494
Reputation: 70
Default Re: [Help] If wanted = no teleport

Code:
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.
__________________
Don't bother to contact me, I'm out of SA-MP
Sascha is offline  
Old 12/01/2011, 03:36 PM   #4
Jimbo01
Big Clucker
 
Join Date: Jul 2010
Posts: 154
Reputation: 1
Default Re: [Help] If wanted = no teleport

thanks
Jimbo01 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wanted Razvann Help Archive 2 09/01/2010 09:18 PM
Need For Pee : Most Wanted [RL&RP] Trooper[Y] Filterscripts 22 22/12/2009 02:23 AM
[Include] [INC]Teleport include. Make teleport in 1 line! AiVAMAN Includes 2 05/09/2009 02:41 PM
/wanted list of persons with wanted [EDIT... problem solved] jesse237 Help Archive 8 24/02/2009 10:19 AM


All times are GMT. The time now is 05:47 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.