Help in a script
#1

//=====================Included===================== =
#include <a_samp>
#include <core>
#include <float>
#include <a_players>
//=====================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 Float:BusCP[10][3] =
{
{1805.6566, -1905.8718, 12.6503}, // Starting of the first checkpoints
{1461.5345, -1727.8889, 12.6229},
{1425.1318, -1406.8177, 12.6267},
{1056.5571, -947.5364, 41.9683},
{535.4228, -1241.4683, 15.7946},
{722.7078, -1409.7432, 12.6111},
{1392.7709, -1437.8511, 12.6262},
{1492.0620, -1736.3679, 12.6232},
{1817.6555, -1781.2073, 12.6235},
{1794.4072, -1885.5101, 12.6399}
};
new DRIVERCP[MAX_PLAYERS];
new BusDriver[MAX_PLAYERS];
//=====================Forwards===============
forward GameModeExitFunc();
//=================Main==================
main()
{
print("\n----------------------------------");
print(" Running Bus Driver Mod");
print(" Coded By");
print(" Fi4ebeam");
print("----------------------------------\n");
}
//======================OnGameModeInit============== =========
public OnGameModeInit()
{
//===[Game Mode Stuff]=======================

ShowPlayerMarkers(1);

ShowNameTags(1);

UsePlayerPedAnims();

//AllowInteriorWeapons(1);
//===[Timers]=======================
//===[Gates]==================================
//===[Drivers]==================================
AddPlayerClass(255,2611.1714,2297.5103,11.1081,90. 3108,0,0,0,0,0,0);//0
AddPlayerClass(258,2611.1714,2297.5103,11.1081,90. 3108,0,0,0,0,0,0);//1
AddPlayerClass(259,2611.1714,2297.5103,11.1081,90. 3108,0,0,0,0,0,0);//2
AddPlayerClass(261,2611.1714,2297.5103,11.1081,90. 3108,0,0,0,0,0,0);//3
AddPlayerClass(262,2611.1714,2297.5103,11.1081,90. 3108,0,0,0,0,0,0);//4
AddPlayerClass(298,2611.1714,2297.5103,11.1081,90. 3108,0,0,0,0,0,0);//5
AddPlayerClass(49,2611.1714,2297.5103,11.1081,90.3 108,0,0,0,0,0,0);//6
AddPlayerClass(57,2611.1714,2297.5103,11.1081,90.3 108,0,0,0,0,0,0);//7
AddPlayerClass(59,2611.1714,2297.5103,11.1081,90.3 108,0,0,0,0,0,0);//8
AddPlayerClass(60,2611.1714,2297.5103,11.1081,90.3 108,0,0,0,0,0,0);//9
AddPlayerClass(70,2611.1714,2297.5103,11.1081,90.3 108,0,0,0,0,0,0);//11
AddPlayerClass(142,2611.1714,2297.5103,11.1081,90. 3108,0,0,0,0,0,0);//12
AddPlayerClass(169,2611.1714,2297.5103,11.1081,90. 3108,0,0,0,0,0,0);//13
AddPlayerClass(181,2611.1714,2297.5103,11.1081,90. 3108,0,0,0,0,0,0);//14
AddPlayerClass(250,2611.1714,2297.5103,11.1081,90. 3108,0,0,0,0,0,0);//15
return 1;
}
//======================GameModeExitFunc============ ===========
public GameModeExitFunc() { GameModeExit(); }
//======================OnPlayerSpawn=============== ========
public OnPlayerSpawn(playerid)
{
return 1;
}
//==================OnPlayerConnect================= =
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid,COLOR_ORANGE,"SERVER: Welcome To Bus Driver Job-LS Area");
SendClientMessage(playerid,COLOR_YELLOW,"SERVER: For More Help Type: /BusHelp");
return 1;
}
//==================OnPlayerDisconnect============== ====
public OnPlayerDisconnect(playerid)
{
}
//===================OnPlayerCommandText============ ==============
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
if(strcmp("/bushelp", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,COLOR_YELLOW,"------------------------------------");
SendClientMessage(playerid,COLOR_YELLOW,"----H-E-L-P-------------------------");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Hello People! Welcome To Bus Driver Job-Around LV[Version 1]");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Your job is driving people around, route by route");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"You need to pass by 10 Bus station,and pickup passengers");
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("/buscmds", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,COLOR_YELLOW,"------------------------------------");
SendClientMessage(playerid,COLOR_YELLOW,"----B-U-S---C-M-D-S-----------------");
SendClientMessage(playerid,COLOR_GREEN,"/Driver - Work as a bus driver[need if you want to earn money]");
SendClientMessage(playerid,COLOR_GREEN,"/DriverOff - Exit bus driver job");
SendClientMessage(playerid,COLOR_GREEN,"/BOpenGate - Opens the gate");
SendClientMessage(playerid,COLOR_GREEN,"/BCloseGate - Closes the gate");
SendClientMessage(playerid,COLOR_GREEN,"/BusCredits - To see who creates this mode");
SendClientMessage(playerid,COLOR_YELLOW,"------------------------------------");
return 1;
}
if(strcmp("/BusCredits", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,COLOR_YELLOW,"------------------------------------");
SendClientMessage(playerid,COLOR_YELLOW,"----C-R-E-D-I-T-S-------------------");
SendClientMessage(playerid,RED,"? Fi4ebeam who create that mod ! ");
SendClientMessage(playerid,RED,"Contact Info:");
SendClientMessage(playerid,RED,"WebSite : Soon...");
SendClientMessage(playerid,RED,"Enjoy this mod! =]");
SendClientMessage(playerid,COLOR_YELLOW,"------------------------------------");
return 1;
}

//===[bus]==================================
if(strcmp("/driver", cmdtext, true, 10) == 0)
{
if(BusDriver[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"You're already a BUS driver!");
if(!IsPlayerInVehicle(playerid,431)) return SendClientMessage(playerid,COLOR_RED,"You're not in the BUS!");
new PName[24];
GetPlayerName(playerid,PName,24);
format(string,256,"%s(id:%d) Is on duty as A Bus Driver",PName,playerid);
SendClientMessageToAll(COLOR_GREEN,string);
SendClientMessage(playerid,COLOR_GREEN,"You Are Now Work As A Bus Driver,Enjoy Your Job Sir!");
DisablePlayerCheckpoint(playerid);
DRIVERCP[playerid]++;
SetPlayerCheckpoint(playerid,BusCP[1][0],BusCP[1][1],BusCP[1][2],5.0);
BusDriver[playerid] = 1;
return 1;
}
if(strcmp("/driveroff", cmdtext, true, 10) == 0)
{
if(BusDriver[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"You're not a bus driver...");
if(!IsPlayerInVehicle(playerid,431)) return SendClientMessage(playerid,COLOR_RED,"You're not in the BUS!");
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_BLUE,string);
SendClientMessage(playerid,RED,"You Are No Longer Work As A Bus Driver!");
DisablePlayerCheckpoint(playerid);
DRIVERCP[playerid] = -1;
SendClientMessage(playerid,COLOR_GREEN,"You have grab all the passengers And you have earned 120$");
BusDriver[playerid] = 0;
return 1;
}
return 0;
}
//===[OnPlayerEnterVehicle]==========================================
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
//======================OnPlayerDeath=============== ========
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid,playerid, reason);
return 1;
}
//======================OnPlayerRequestClass======== ===============
public OnPlayerRequestClass(playerid, classid)
{
return 1;
}
//======================SetupPlayerForClassSelection =======================

//=============================On Enter Checkpoint==============================
public OnPlayerEnterCheckpoint(playerid)
{
switch(DRIVERCP[playerid])
{
case 0:
{
if(!IsPlayerInVehicle(playerid,431))
{
SendClientMessage(playerid,COLOR_RED,"You're not in the BUS!");
}
else
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,BusCP[DRIVERCP[playerid]+1][0],BusCP[DRIVERCP[playerid]+1][1],BusCP[DRIVERCP[playerid]+1][2],5.0);
DRIVERCP[playerid]++;
}
}
case 1..57:
{
if(!IsPlayerInVehicle(playerid,431))
{
SendClientMessage(playerid,RED,"You're not in the BUS!");
}
else
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,BusCP[DRIVERCP[playerid]+1][0],BusCP[DRIVERCP[playerid]+1][1],BusCP[DRIVERCP[playerid]+1][2],5.0);
DRIVERCP[playerid]++;
}
}
case 58:
{
if(!IsPlayerInVehicle(playerid,431))
{
SendClientMessage(playerid,RED,"You're not in the BUS!");
}
else
{
DisablePlayerCheckpoint(playerid);
DRIVERCP[playerid] = -1;
SendClientMessage(playerid,COLOR_GREEN,"You have grab all the passengers And you have earned 120$");
GivePlayerMoney(playerid,120);
BusDriver[playerid] = 0;
}
}
}
return 1;
}
//===[OnPlayerLeaveCheckpoint]==========================================
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
//End of the mod!


Im having problems , when i try and do /driver it doesn't work and it says ''Your not in a BUS'', help help help pls
Reply
#2

coz u added this if(!IsPlayerInVehicle(playerid,431)) return SendClientMessage(playerid,COLOR_RED,"You're not in the BUS!"); So just try in that VEH 431 i:e Bus
Reply
#3

What do you mean, cause i've did ''431'', i need to change that to ''Bus''?
Reply
#4

Nope lol Just sit in bus and /driver
Reply
#5

didn't work
Reply
#6

if(BusDriver[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"You're already a BUS driver!"); remove this and try
Reply
#7

Or add a cmd /takejob And add this to it BusDriver[playerid] = 1
Reply
#8

it still says ''Your not in a bus''
Reply
#9

Did u try it in a bus ?
Reply
#10

yes i did try it in a bus
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)