All pastes #960874 Raw Edit

Something

public text v1 · immutable
#960874 ·published 2008-03-28 14:52 UTC
rendered paste body
#include <a_samp>

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

new HasPlayerPass[MAX_PLAYERS] = 0;
new PeageIcon;
new BuyPass;
new tollgate;
#if defined FILTERSCRIPT

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

public OnGameModeInit()
{
	PeageIcon = CreatePickup (2222, 2, 1805.6426,-1897.8104,13.4034);
	Buypass = CreatePickup (2222, 2,-2686.646973, 1274.859985, 53.240269);
	tollgate = CreateObject(985, -2677.150391, 1274.916138, 53.265087, 0.0000, 0.0000, 0.0000);
    CreateObject(985, -2686.646973, 1274.859985, 53.240269, 0.0000, 0.0000, 180.0000);
	CreateObject(985, -2695.297119, 1275.006470, 53.265179, 0.0000, 0.0000, 0.0000);  //
	CreateObject(985, -2667.604492, 1275.016846, 53.290226, 0.0000, 0.0000, 180.0000);
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print("By wonderful oak,and amazing ROYtjuh :)");
	print("----------------------------------\n");
}

#endif

//------------------------[FORWARDS]------------------------------------------
forward PlayerToPoint(Float:radi, playerid,Float:x, Float:y, Float:z);
//----------------------------------------------------------------------------
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);
	tempposy = (oldposy -y);
	tempposz = (oldposz -z);
	if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
	{
		return 1;
	}
	return 0;
}
//---------------------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])//Ff koppieren pls<<
{
	if (strcmp("/showpass", cmdtext, true, 10) == 0)
	{
		if(PlayerToPoint(40.0,playerid,-2673.457119, 1275.008470, 53.265179))
			{
			    if (HasPlayerPass[playerid] == 1)
			    {
				SendClientMessage(playerid, 0xFFFFFFAA, "You may pass, have a safe trip!");
   				MoveObject(tollgate, -2677.145752, 1274.930298, 46.066166, 0.0000);
				return 1;
				}else{
				SendClientMessage(playerid, 0xFFFFFFAA, "Please buy a ticket to pass");
 			}
    }
}
	if (strcmp("/buypass", cmdtext, true, 10) == 0)
	{
		if(PlayerToPoint(10.0,playerid,-2686.646973, 1274.859985, 53.240269))
			{
			SendClientMessage(playerid, 0xFFFFFFAA, "You have bought a passport, have a safe trip!");
			GivePlayerMoney(playerid, -500);
			return 1;
			}else{
			SendClientMessage(playerid, 0xFFFFFFAA, "You are not at the ticketmachine!"); // mm volegns mij heb
		}
	}
	return 0;
	}//done :P

//--------------OnPlayerpickupPickUP--------------------------------------
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == PeageIcon)
{
GameTextForPlayer(playerid, "~r~Welcome, ~y~to the ~r~bayside gates ~n~~w~Type ~b~/showpassport if you wish ~n~to pass", 3000, 4);
}
if(pickupid == BuyPass)
{
GameTextForPlayer(playerid, "~r~Welcome, ~y~to the ~r~the ticket machine ~n~~w~Type ~b~/buypass ~w~to gain one", 3000, 5);
}
return 1;
}