i am using the script as a filterscript on my server first of all i was wondering anyone no how to make more lines ? ive messaged creator but he didnt reply, also is there anyway i can implement into my game mode as its a trucking server so would like a bus driver script. all help apreiciated
pawn Code:
/*------------------------------
| Bus Driver Las Venturas V2 |
| ©GiP YossI©-GTA.Vgames.co.il |
| http://www.VGames.co.il |
| For Help type /BusHelp |
| Pleas read The ReadMe File |
-----------------------------*///=====================Included======================#include <a_samp>#include <core>#include <float>#include <a_players>//#include <cpstream>//=====================Defines=======================#define COLOR_GREY 0xAFAFAFAA#define COLOR_GREEN 0x33AA33AA#define COLOR_RED 0xAA3333AA#define COLOR_YELLOW 0xFFFF00AA#define COLOR_WHITE 0xFFFFFFAA#define COLOR_BLUE 0x0000BBAA#define COLOR_LIGHTBLUE 0x33CCFFAA#define COLOR_ORANGE 0xFF9900AA#define COLOR_BLACK 0x000000AA#define COLOR_TRANS 0xFFFFFF00#define RED 0xE60000FF//================News====================new gate,gateb,gatec,gated,gatee;
new IsDriver
[MAX_PLAYERS
];
new Float:LineOne
[27][3] ={ // Starting of the first checkpoints{2305.2368,
2516.6831,
10.4390},
{2370.9231,
2710.3923,
10.4395},
{2305.2368,
2516.6831,
10.4390},
{2083.8154,
2455.3525,
10.4372},
{2025.5984,
2411.6221,
10.4439},
{2125.0093,
2046.9979,
10.4410},
{2076.8469,
1770.2521,
10.4414},
{2021.9395,
1455.9333,
10.4400},
{1709.0303,
1430.8904,
10.2773},
{1720.5106,
1379.5804,
10.2610},
{1724.2919,
1364.9584,
10.2613},
{1717.2992,
1299.6481,
10.5842},
{1677.3872,
1291.1377,
10.5938},
{1664.8894,
1310.9811,
10.5847},
{1718.1025,
1306.9657,
10.5843},
{1715.9889,
1421.8490,
10.2618},
{1725.7554,
1479.7607,
10.4392},
{1719.3071,
1708.7047,
10.7014},
{2076.5002,
1714.9136,
10.4395},
{1910.8204,
1710.1782,
10.4403},
{2076.5002,
1714.9136,
10.4395},
{2148.7058,
1977.6278,
10.4492},
{2151.0146,
2225.3906,
10.4412},
{2230.6650,
2501.8965,
10.4411},
{2389.1960,
2527.8123,
10.4412},
{2376.2012,
2714.9922,
10.4478},
{2349.0078,
2727.9124,
10.5871}};
new Float:LineTow
[54][3] ={ // Starting of the first checkpoints{1066.8674,
1367.8768,
10.8623},
{2384.6448,
2644.8538,
13.0952},
{2305.1201,
2516.7351,
10.4415},
{2189.6055,
2455.8914,
10.4412},
{2087.7488,
2454.4463,
10.4412},
{2025.3187,
2378.2732,
10.4405},
{2072.8452,
2285.1902,
10.4412},
{1895.0326,
2276.1936,
10.4412},
{1638.4473,
2260.4082,
10.5856},
{1618.6821,
2260.2173,
10.5874},
{1605.9443,
2255.1765,
10.5877},
{1621.9208,
2249.0947,
10.5879},
{1657.6917,
2256.7214,
10.5874},
{1710.6038,
2269.9622,
10.4413},
{1913.0377,
2272.8259,
10.4412},
{1998.7552,
1451.1940,
10.4412},
{1944.7743,
1354.3763,
8.8743},
{1970.5630,
1271.7600,
10.4412},
{2044.1698,
1235.1327,
10.4411},
{2040.0068,
1006.9365,
10.4430},
{2052.0471,
981.3029,
10.4092},
{2063.0203,
981.1089,
10.4053},
{2069.3186,
997.3919,
10.4412},
{2102.7581,
1044.9194,
10.4588},
{2170.8374,
1117.0669,
12.3946},
{2188.3701,
1180.8176,
10.5224},
{2189.8762,
1283.3461,
10.4411},
{2161.7756,
1376.6146,
10.4412},
{2074.4839,
1432.2308,
10.4340},
{2074.6953,
1519.4539,
10.4403},
{2071.8564,
1635.2075,
10.4442},
{2086.8018,
1644.5271,
10.4546},
{2158.7346,
1675.8595,
10.4601},
{2098.9519,
1721.6580,
10.4568},
{2140.7991,
1835.7770,
10.4412},
{2154.0215,
1934.2157,
10.4411},
{2156.2856,
2060.6838,
10.4400},
{2218.8889,
2132.7659,
10.4414},
{2273.6360,
2133.8818,
10.4412},
{2373.1045,
2136.3438,
10.4411},
{2408.7773,
2135.7217,
10.4412},
{2493.9058,
2134.6467,
10.4408},
{2525.3401,
2139.0562,
10.4412},
{2518.8286,
2147.6824,
10.4403},
{2444.1934,
2152.5208,
10.4411},
{2333.8208,
2152.6475,
10.4467},
{2260.6218,
2151.7075,
10.4412},
{2187.2595,
2151.6628,
10.4412},
{2154.7129,
2186.2761,
10.4411},
{2229.8477,
2456.9592,
10.5718},
{2315.5154,
2509.9155,
10.4413},
{2389.4126,
2641.6394,
13.2457},
{2372.6802,
2714.6379,
10.4411},
{2349.6711,
2728.7917,
10.5881}};
new Float:LineThree
[4][3] ={ {1066.7091,
1365.9642,
10.7851},
// Starting of the first checkpoints {1325.6041,
1191.4697,
10.6719},
{2024.6964,
970.4431,
10.4768},
{973.5925,
758.0493,
10.7075}};
/*
new Float:LineFour[7][3] =
{
{2785.025391,2288.221924,9.820313}, // Starting of the first checkpoints
{2785.025391,2288.221924,9.820313},
{2842.465576,2233.934570,9.671875},
{2841.851074,2137.836426,9.820313}
};
*/new DRIVERCP
[MAX_PLAYERS
];
//new IconHelpGarage,IconHelpEnter,IconHelpParking;//=====================Forwards===============forward IfIsDriver
(playerid
);
forward GameModeExitFunc
();
forward SetupPlayerForClassSelection
(playerid
);
forward line1
(playerid
);
forward line2
(playerid
);
//=================Main==================main
(){ print("\n----------------------------------");
print(" Running Bus Driver Mod");
print(" Coded By");
print(" GiP YossI");
print("----------------------------------\n");
}//======================OnGameModeInit=======================public OnGameModeInit
(){//===[Game Mode Stuff]=======================SetGameModeText
("Long Haul Trucking");
ShowPlayerMarkers
(1);
ShowNameTags
(1);
UsePlayerPedAnims
();
//===[Drivers]==================================//===[PickUps]====================================//IconHelpGarage = AddStaticPickup(1239,20, 2282.250488, 2792.692138, 10.014780);//IconHelpEnter = AddStaticPickup(1239,20, 2353.848876, 2724.814697, 10.014780);//IconHelpParking = AddStaticPickup(1239,20, 2391.662353, 2734.634521, 10.014780);return 1;
}//======================GameModeExitFunc=======================public GameModeExitFunc
() { GameModeExit
();
}//======================OnPlayerSpawn=======================//==================OnPlayerConnect==================//==================OnPlayerDisconnect==================public OnPlayerDisconnect
(playerid
){IsDriver
[playerid
] = 0;
}//===================OnPlayerCommandText==========================public OnPlayerCommandText
(playerid, cmdtext
[]){ new cmd
[128], idx;
cmd
= strtok
(cmdtext, idx
);
new string
[128];
//if(strcmp(cmd, "/openg", true) == 0) if(strcmp("/openg", cmdtext, true,
10) == 0) { MoveObject
(gatec,
2280.806396,
2809.380126,
9.982222,
2.0);
MoveObject
(gated,
2280.822265,
2780.573974,
9.982222,
2.0);
return 1;
} //if(strcmp(cmd, "/closeg", true) == 0) if(strcmp("/closeg", cmdtext, true,
10) == 0) { MoveObject
(gatec,
2280.806396,
2800.380126,
9.982222,
2.0);
MoveObject
(gated,
2280.822265,
2791.573974,
9.982222,
2.0);
return 1;
} //if(strcmp(cmd, "/openm", true) == 0) if(strcmp("/openm", cmdtext, true,
10) == 0) { MoveObject
(gate,
2336.041259,
2723.225341,
12.588180,
2.0);
return 1;
} //if(strcmp(cmd, "/closem", true) == 0) if(strcmp("/closem", cmdtext, true,
10) == 0) { MoveObject
(gate,
2347.041259,
2723.225341,
12.588180,
2.0);
return 1;
} //if(strcmp(cmd, "/openp", true) == 0) if(strcmp("/openp", cmdtext, true,
10) == 0) { MoveObject
(gateb,
2391.230957,
2729.525634,
11.530980,
2.0);
return 1;
} //if(strcmp(cmd, "/closep", true) == 0) if(strcmp("/closep", cmdtext, true,
10) == 0) { MoveObject
(gateb,
2391.230957,
2737.525634,
11.530980,
2.0);
return 1;
} //if(strcmp(cmd, "/opens", true) == 0) if(strcmp("/opens", cmdtext, true,
10) == 0) { MoveObject
(gatee,
2237.805175,
2785.192626,
12.593704,
2.0);
return 1;
} //if(strcmp(cmd, "/closes", true) == 0) if(strcmp("/closes", cmdtext, true,
10) == 0) { MoveObject
(gatee,
2237.805175,
2773.192626,
12.593704,
2.0);
return 1;
} //if(strcmp(cmd, "/openall", true) == 0) if(strcmp("/openall", cmdtext, true,
10) == 0) { MoveObject
(gate,
2336.041259,
2723.225341,
12.588180,
2.0);
MoveObject
(gateb,
2391.230957,
2729.525634,
11.530980,
2.0);
MoveObject
(gatec,
2280.806396,
2809.380126,
9.982222,
2.0);
MoveObject
(gated,
2280.822265,
2780.573974,
9.982222,
2.0);
MoveObject
(gatee,
2237.805175,
2785.192626,
12.593704,
2.0);
return 1;
} //if(strcmp(cmd, "/closeall", true) == 0) if(strcmp("/closeall", cmdtext, true,
10) == 0) { MoveObject
(gate,
2347.041259,
2723.225341,
12.588180,
2.0);
MoveObject
(gateb,
2391.230957,
2737.525634,
11.530980,
2.0);
MoveObject
(gatec,
2280.806396,
2800.380126,
9.982222,
2.0);
MoveObject
(gated,
2280.822265,
2791.573974,
9.982222,
2.0);
MoveObject
(gatee,
2237.805175,
2773.192626,
12.593704,
2.0);
return 1;
} //===[bus]================================== //if(strcmp(cmd, "/bus", true) == 0) if(strcmp("/bus", cmdtext, false,
10) == 0) { if(!IsPlayerInAnyVehicle
(playerid
)) { SetPlayerPos
(playerid,
2373.1160,
2738.7966,
10.9127);
SetPlayerFacingAngle
(playerid,
88.4520);
SetPlayerInterior
(playerid,
0);
}else { SetVehiclePos
(GetPlayerVehicleID
(playerid
),
2384.1970,
2755.2878,
13.6976);
SetVehicleZAngle
(GetPlayerVehicleID
(playerid
),
175.5421);
SetPlayerInterior
(playerid,
0);
LinkVehicleToInterior
(GetPlayerVehicleID
(playerid
),
0);
} return 1;
} //if(strcmp(cmd, "/line", true) == 0) if(strcmp("/line", cmdtext, true,
10) == 0) { SendClientMessage
(playerid,COLOR_YELLOW,
"----L-I-N-E-S-----------------------");
SendClientMessage
(playerid,COLOR_GREY,
"Line 1 - Airport Shuttle");
SendClientMessage
(playerid,COLOR_GREY,
"Line 2 - Casino Shuttle");
SendClientMessage
(playerid,COLOR_GREY,
"Line 3 - [Your Own Line]");
SendClientMessage
(playerid,COLOR_GREY,
"Line 4 - [Your Own Line]");
SendClientMessage
(playerid,COLOR_GREY,
"Usage : /sline [line number] ");
SendClientMessage
(playerid,COLOR_YELLOW,
"------------------------------------");
return 1;
} //if(strcmp(cmd, "/bushelp", true) == 0) if(strcmp("/bushelp", cmdtext, false,
10) == 0) { SendClientMessage
(playerid,COLOR_YELLOW,
"------------------------------------");
SendClientMessage
(playerid,COLOR_YELLOW,
"----H-E-L-P-------------------------");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"Hello People! Welcom To Bus Driver Job-Around LV[Version 2]");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"In This Game Mode You Can Be A Bus Driver");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"You need to choose a line, and then drive there by the checkpoints");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"When you over with the trip,you will get money :) Enjoy!");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"Want more help? /BusCmds");
SendClientMessage
(playerid,COLOR_YELLOW,
"------------------------------------");
return 1;
} //if(strcmp(cmd, "/buscmds", true) == 0) if(strcmp("/buscmds", cmdtext, false,
10) == 0) { SendClientMessage
(playerid,COLOR_YELLOW,
"------------------------------------");
SendClientMessage
(playerid,COLOR_YELLOW,
"----B-U-S---C-M-D-S-----------------");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"/Bus - Teleport to the Bus Station.");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"/Line - To Choose your destenation");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"/SLine - To see the list of your destenation");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"/Driver - Work as a bus driver[need if you want to earn money]");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"/DriverOff - exit bus driver job");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"/OpenE - CloseE - Opens/Closes the Main gate");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"/OpenP - /CloseP - Opens/Closes the Parking gate");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"/OpenG - /CloseG - Opens/Closes the Garage gate");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"/OpenAll - /CloseAll - Opens/Closes All of the gates");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"/BusCredits - To see who creates this mode");
SendClientMessage
(playerid,COLOR_YELLOW,
"------------------------------------");
return 1;
} //if(strcmp(cmd, "/buscredits", true) == 0) if(strcmp("/buscredits", cmdtext, false,
10) == 0) { SendClientMessage
(playerid,COLOR_YELLOW,
"------------------------------------");
SendClientMessage
(playerid,COLOR_YELLOW,
"----C-R-E-D-I-T-S-------------------");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"© [GiP]YossI / Yossi_Trabelsi who create that mod ! :)");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"Contact Info:");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"Email: YossiTrabelsi@Gmail.com");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"WebSite : Soon...");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"SA:MP Forum Profile : GiP YossI");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"Enjoy this mod! =]");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"/SpacielThanks");
SendClientMessage
(playerid,COLOR_YELLOW,
"------------------------------------");
return 1;
} //if(strcmp(cmd, "/spacielthanks", true) == 0) if(strcmp("/spacielthanks", cmdtext, false,
10) == 0) { SendClientMessage
(playerid,COLOR_YELLOW,
"------------------------------------");
SendClientMessage
(playerid,COLOR_YELLOW,
"----S-P-A-C-I-E-L--T-H-A-N-K-S------");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"To [GiP]YossI / Yossi_Trabelsi who create that mod ! :)");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"To SA:MP Forum for helping me with some functions.");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"To Seif Create a DMV FS");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"To Seif_convertor for the object conretor");
SendClientMessage
(playerid,COLOR_LIGHTBLUE,
"To MenaceX^+Redgie for the help with the lines,and buses");
SendClientMessage
(playerid,COLOR_YELLOW,
"------------------------------------");
return 1;
} //if(strcmp(cmd, "/onduty", true) == 0) if(strcmp("/onduty", cmdtext, true,
10) == 0) { if(GetVehicleModel
(GetPlayerVehicleID
(playerid
))!=437) return SendClientMessage
(playerid,COLOR_GREY,
"You're not in a bus.");
if(IsDriver
[playerid
] == 1) return SendClientMessage
(playerid, 0xFFFFFFAA,
"You Are already a bus driver [/offduty]");
SendClientMessage
(playerid,COLOR_GREEN,
"As a driver,you have 4 line to drive. choose line by the command: /line");
IsDriver
[playerid
] = 1;
new PName
[24];
GetPlayerName
(playerid,PName,
24);
format(string,
256,
"%s(id:%d) Is on duty as A Bus Driver",PName,playerid
);
SendClientMessageToAll
(COLOR_ORANGE,string
);
SendClientMessage
(playerid,COLOR_GREEN,
"Drive the Lines using /slines 1-4 To earn Score and Cash");
return 1;
} //if(strcmp(cmd, "/offduty", true) == 0) if(strcmp("/offduty", cmdtext, true,
10) == 0) { if(IsDriver
[playerid
] == 0) return SendClientMessage
(playerid, 0xFFFFFFAA,
"You Are not a bus driver [/onduty]");
new PName
[24];
GetPlayerName
(playerid,PName,
24);
format(string,
256,
"%s(id:%d) Is no longer on duty as A Bus Driver",PName,playerid
);
SendClientMessageToAll
(COLOR_ORANGE,string
);
SendClientMessage
(playerid,RED,
"You Are No Longer Work As A Bus Driver!");
DisablePlayerCheckpoint
(playerid
);
DRIVERCP
[playerid
] = -1;
SendClientMessage
(playerid,COLOR_GREEN,
"Your shift has finished");
return 1;
} //if(strcmp("/sline", cmdtext, true, 10) == 0) if(strcmp(cmd,
"/sline", true
) == 0) { new tmp
[128];
tmp
= strtok
(cmdtext, idx
);
if(!strlen(tmp
)) { SendClientMessage
(playerid, 0xFFFFFFAA,
"USAGE: /sline [line number]");
return 1;
} new param2
=strval(tmp
);
if(param2
>4 || param2
<1) { SendClientMessage
(playerid, 0xFFFFFFAA,
"line number must be between 1-4");
return 1;
} if(IsDriver
[playerid
] == 0) { SendClientMessage
(playerid, 0xFFFFFFAA,
"You Are not a bus driver [/driver]");
return 1;
} if(param2
== 1) { SendClientMessage
(playerid, 0xFFFFFFAA,
"You have selected the line that go to Airports");
DisablePlayerCheckpoint
(playerid
);
DRIVERCP
[playerid
]++;
SetPlayerCheckpoint
(playerid,LineOne
[1][0],LineOne
[1][1],LineOne
[1][2],
5.0);
return 1;
} if(param2
== 2) { DisablePlayerCheckpoint
(playerid
);
DRIVERCP
[playerid
]++;
SetPlayerCheckpoint
(playerid,LineTow
[1][0],LineTow
[1][1],LineTow
[1][2],
5.0);
} return 1;
} return 0;
}//===[OnPlayerEnterVehicle]==========================================public OnPlayerEnterVehicle
(playerid, vehicleid, ispassenger
){return 1;
}//=============================On Enter Checkpoint==============================public OnPlayerEnterCheckpoint
(playerid
){ switch(DRIVERCP
[playerid
]) { case 0: { if(GetVehicleModel
(GetPlayerVehicleID
(playerid
))!=437) return SendClientMessage
(playerid,COLOR_GREY,
"You're not in a bus.");
else { DisablePlayerCheckpoint
(playerid
);
SetPlayerCheckpoint
(playerid,LineOne
[DRIVERCP
[playerid
]+1][0],LineOne
[DRIVERCP
[playerid
]+1][1],LineOne
[DRIVERCP
[playerid
]+1][2],
5.0);
DRIVERCP
[playerid
]++;
} } case 1..
24: { if(GetVehicleModel
(GetPlayerVehicleID
(playerid
))!=437) return SendClientMessage
(playerid,COLOR_GREY,
"You're not in a bus.");
else { DisablePlayerCheckpoint
(playerid
);
SetPlayerCheckpoint
(playerid,LineOne
[DRIVERCP
[playerid
]+1][0],LineOne
[DRIVERCP
[playerid
]+1][1],LineOne
[DRIVERCP
[playerid
]+1][2],
5.0);
DRIVERCP
[playerid
]++;
} } case 25: { if(GetVehicleModel
(GetPlayerVehicleID
(playerid
))!=437) return SendClientMessage
(playerid,COLOR_GREY,
"You're not in a bus.");
else { DisablePlayerCheckpoint
(playerid
);
DRIVERCP
[playerid
] = -1;
SendClientMessage
(playerid,COLOR_GREEN,
"You have finished your shift and have earnt $2000");
GivePlayerMoney
(playerid,
2000);
} } } return 1;
}//===[OnPlayerLeaveCheckpoint]==========================================public OnPlayerLeaveCheckpoint
(playerid
){return 1;
}//===[OnPlayerEnterRaceCheckpoint]==========================================public OnPlayerEnterRaceCheckpoint
(playerid
){return 1;
}//===[OnPlayerLeaveRaceCheckpoint]==========================================public OnPlayerLeaveRaceCheckpoint
(playerid
){return 1;
}//======================OnPlayerDeath=======================public OnPlayerDeath
(playerid, killerid, reason
){ SendDeathMessage
(killerid,playerid, reason
);
return 1;
}//======================OnPlayerRequestClass=======================public OnPlayerRequestClass
(playerid, classid
){ SetupPlayerForClassSelection
(playerid
);
return 1;
}//======================OnPlayerPickUpPickup======================public OnPlayerPickUpPickup
(playerid, pickupid
){/*
if(pickupid == IconHelpEnter)
{
SendClientMessage(playerid,0xFF8C13FF,"/Usage: /OpenM or to Close use: /CloseM");
return 1;
}
if(pickupid == IconHelpGarage)
{
SendClientMessage(playerid,0xFF8C13FF,"/Usage: /OpenG or to Close use: /CloseG");
return 1;
}
if(pickupid == IconHelpParking)
{
SendClientMessage(playerid,0xFF8C13FF,"/Usage: /OpenP or to Close use: /CloseP");
return 1;
}
*/return 1;
}//======================SetupPlayerForClassSelection=======================public SetupPlayerForClassSelection
(playerid
){ SetPlayerPos
(playerid,
2390.1260,
2737.0750,
10.8203);
SetPlayerFacingAngle
(playerid,
94.8825);
SetPlayerCameraPos
(playerid,
2385.3428,
2736.8882,
10.8203);
SetPlayerCameraLookAt
(playerid,
2390.1260,
2737.0750,
10.8203);
}//===[IsDriver]==========================================public IfIsDriver
(playerid
){return 1;
}//------------------------strtok-----------------------------------------strtok
(const string
[],
&index
){ new length
= strlen(string
);
while ((index
< length
) && (string
[index
] <= ' ')) { index
++;
} new offset
= index;
new result
[20];
while ((index
< length
) && (string
[index
] > ' ') && ((index
- offset
) < (sizeof(result
) - 1))) { result
[index
- offset
] = string
[index
];
index
++;
} result
[index
- offset
] = EOS;
return result;
}