/enter and /exit CMDS help
#5

Did that :


Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT

#include <a_samp>

forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}



public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
if(!strcmp("/Enter", cmdtext, true))
 {
    if(IsPlayerInRangeOfPoint(playerid,3,1333.5809326172,-1863.5708007813,14.039328575134))
    SetPlayerInterior(playerid, 1);
    SetPlayerPos(playerid,2064.185546875,-2071.7348632813,1115.2646484375);
    CreatePickup(1239,2,1333.5863037109,-1864.8194580078,14.652570724487);
    return 1;
}
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;
}
And still entering at any place
Reply


Messages In This Thread
/enter and /exit CMDS help - by Mr.Black - 14.06.2011, 18:50
Re: /enter and /exit CMDS help - by 0_o - 14.06.2011, 18:58
Re: /enter and /exit CMDS help - by Skidmarks - 14.06.2011, 18:59
Re: /enter and /exit CMDS help - by 0_o - 14.06.2011, 19:07
Re: /enter and /exit CMDS help - by Mr.Black - 14.06.2011, 19:12
Re: /enter and /exit CMDS help - by Wesley221 - 14.06.2011, 19:15
Re: /enter and /exit CMDS help - by Bob_Raw - 14.06.2011, 19:33
Re: /enter and /exit CMDS help - by Mr.Black - 14.06.2011, 19:36
Re: /enter and /exit CMDS help - by Treyvan - 14.06.2011, 19:51
Re: /enter and /exit CMDS help - by Mr.Black - 14.06.2011, 20:00

Forum Jump:


Users browsing this thread: 1 Guest(s)