rendered paste body/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
This Script Was Done By Khaled Raouf Plz Report Any Bugs
Msn:river_zoqak@hotmail.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\*/
#include <a_samp>
#include<a_objects>
#define COLOR_SYSTEM 0xB2EBE0AA
//~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~
//forwards
forward F1();
forward F2();
forward F3();
forward F4();
forward F5();
forward F6();
forward Cam(playerid);
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
forward PlaneInPos(Float:radi,Float:x, Float:y, Float:z);
//new
new Plane;
//~~~~~~~~~~~~~~~~~~~~~
#define FILTERSCRIPT
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Flight Bot 0.1C by Khaled Raouf");
print("--------------------------------------\n");
Plane = CreateObject(1683, 2115.552734, -2442.980469, 18.449501, 0.0000, 0.0000, 270.0001); //Plane
CreateObject(3881, 2091.363281, -2478.347412, 14.398438, 0.0000, 0.0000, 67.5000); //Ticket Saler
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Flight Bot 0.1C by Khaled Raouf");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid,COLOR_SYSTEM,"Flight Bot Script By Khaled Raouf for info type /bs if you admin type /bsa");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/bs", cmdtext, true) == 0)
{
SendClientMessage(playerid,COLOR_SYSTEM,"[Plane Script] /BuyTicket /EF");
return 1;
}
if (strcmp("/bsa", cmdtext, true) == 0)
{
if (IsPlayerAdmin(playerid))
{
SendClientMessage(playerid,COLOR_SYSTEM,"[Plane Script] /flyb /tower /scam [off]");
}
return 1;
}
if (strcmp("/tower", cmdtext, true) == 0)
{
if (IsPlayerAdmin(playerid))
{
new Float:x,Float:y,Float:z;
GetObjectPos(Plane,x,y,z);
SetPlayerPos(playerid,x +10,y -10,z);
}
return 1;
}
if (strcmp("/buyticket", cmdtext, true) == 0)
{
if (PlayerToPoint(3, playerid,2091.363281, -2478.347412, 14.398438) || PlaneInPos(1,2115.552734, -2442.980469, 18.449501))
{
GivePlayerMoney(playerid,-500);
SetPlayerInterior(playerid,1);
SetPlayerPos(playerid,2.384830,33.103397,1199.849976);
SendClientMessage(playerid,COLOR_SYSTEM,"[Ticket Seller] You Did Buy Ticket To San Fiaro Type /EF To Exit");
GivePlayerWeapon(playerid,46,1);
}
else {
SendClientMessage(playerid,COLOR_SYSTEM,"You Aren't At Ticket Sell Place");
}
return 1;
}
if (strcmp("/ef", cmdtext, true) == 0)
{
new Float:x,Float:y,Float:z;
GetObjectPos(Plane,x,y,z);
SetPlayerPos(playerid,x +10,y -10,z);
SetPlayerInterior(playerid,0);
return 1;
}
if (strcmp("/flyb", cmdtext, true) == 0)
{
if (IsPlayerAdmin(playerid) || PlaneInPos(1,2115.552734, -2442.980469, 18.449501))
{
new Float:x,Float:y,Float:z;
GetObjectPos(Plane,x,y,z);
//PlayerPlaySound(playerid,128,2.384830,33.103397,1199.849976); not working yet
//PlayerPlaySound(playerid,128,x,y,z); not working yet
SetTimer("F1",50,0);
SendClientMessageToAll(COLOR_SYSTEM,"=Flight Beta= HOA5 AirTrip Started");
}
return 1;
}
if (strcmp("/scam", cmdtext, true) == 0)
{
if (IsPlayerAdmin(playerid))
{
SetTimer("Cam",50,1);
}
}
return 1;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~Pos Checker~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
public PlaneInPos(Float:radi,Float:x,Float:y,Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetObjectPos(Plane,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;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~BASIC SCRIPTS~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public F1()
{
MoveObject(Plane,2092.911133, -2584.532715, 18.449501,15);
SetObjectRot(Plane,0.0000, 0.0000, 270.0001);
SetTimer("F2",50,1);
return 1;
}
public F2()
{
if (PlaneInPos(1,2092.911133, -2584.532715, 18.449501))
{
MoveObject(Plane,1928.374023, -2593.678223, 18.449501,20);
SetObjectRot(Plane,0.0000, 0.0000, 180.0000);
SetTimer("F3",50,1);
}
return 1;
}
public F3()
{
if (PlaneInPos(1,1928.374023, -2593.678223, 18.449501))
{
MoveObject(Plane,1740.796631, -2592.314941, 71.330185,25);
SetObjectRot(Plane,0.0000, 0.0000, 180.0000);
SetTimer("F4",50,1);
}
return 1;
}
public F4()
{
if (PlaneInPos(1,1740.796631, -2592.314941, 71.330185))
{
MoveObject(Plane,1061.877930, -2335.211426, 138.184769,30);
SetObjectRot(Plane,0.0000, 0.0000, 146.2501);
SetTimer("F5",50,1);
}
return 1;
}
public F5()
{
if (PlaneInPos(1,1061.877930, -2335.211426, 138.184769))
{
MoveObject(Plane,189.240173, -2135.225342, 285.323059,50);
SetObjectRot(Plane,0.0000, 0.0000, 191.2501);
SetTimer("F6",50,1);
}
return 1;
}
public F6()
{
if (PlaneInPos(1,189.240173, -2135.225342, 285.323059))
{
MoveObject(Plane,-1341.435547, 116.398148, 19.043514,30);
SetObjectRot(Plane,0.0000, 0.0000,-260.0000);
}
return 1;
}
public Cam(playerid)
{
new Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz;
GetObjectPos(Plane,x,y,z);
GetObjectRot(Plane,rx,ry,rz);
SetPlayerCameraPos(playerid, x + -50*floatsin(rz, degrees), y + -50*floatcos(rz, degrees), z + 50);
SetPlayerCameraLookAt(playerid, x + 10*floatsin(rz, degrees), y + 10*floatcos(rz, degrees), z);
return 1;
}