bus mission start and checkpoint help
#1

hey i made this and when you enter one of the buses you can do press 2 a million times and the bus driver mission will start? i dont want that. and when i get to the second checkpoint nothing happens D: (o and when i entervehicle its surpose to say the gametext but it doesn't>?)
Код:
#include <a_samp>

#define COLOR_DARKGOLD 0x808000AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define	YELLOW 0xFFFF00AA
#define LIME 0x00FF00FF

#define PRESSED(%0) \
	(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define HOLDING(%0) \
	((newkeys & (%0)) == (%0))
#define RELEASED(%0) \
	(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))

#define buspoint1 -1998.7400,174.6382,27.6473
#define buspoint2 -1805.8813,600.1848,34.8620
#define buspoint3 -1601.1205,726.2743,11.1720
#define buspoint4 -1612.7714,857.1121,7.6761
#define buspoint5 -1766.0300,935.1175,24.8755
#define buspoint6 -1904.0560,811.3516,36.1556
#define buspoint7 -2648.9529,570.7150,14.5943
#define buspoint8 -2614.7012,215.6137,5.2519
#define buspoint9 -2150.6584,148.2724,35.3053
#define buspoint10 -2061.5159,-74.0719,34.8552

new bus1;
new bus2;
new bus3;
new busdriver = 0;

public OnFilterScriptInit()
{
bus1 = AddStaticVehicle(431,-1988.7975,192.1375,27.6358,359.7323,75,59); // bus1
bus2 =	AddStaticVehicle(431,-1988.8607,178.5440,27.6378,359.7324,75,59); // bus2
bus3 =	AddStaticVehicle(431,-1988.9200,165.7481,27.6426,359.7370,75,59); // bus3

}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/start", cmdtext, true, 10) == 0)
    {
    new veh = GetPlayerVehicleID(playerid);
		if(veh == bus3 || veh == bus2 || veh == bus1)
    {
      busdriver = 1;
      SetPlayerCheckpoint(playerid, buspoint1, 3.0);
      GameTextForPlayer(playerid, "~g~Bus Driver Started!", 3000, 3);
      new name[MAX_PLAYER_NAME], string[48];
      GetPlayerName(playerid, name, sizeof(name));
      format(string, sizeof(string), "%s Is Now A Bus Driver!.", name );
      SendClientMessageToAll(COLOR_RED, string);
      return 1;
      }
    SendClientMessage(playerid, COLOR_RED,"You have to be in a busdriver van to start the job");
    }
    if (strcmp("/busdriverinfo", cmdtext, true, 10) == 0)
    {
      SendClientMessage(playerid, COLOR_YELLOW, ".");
      SendClientMessage(playerid, COLOR_YELLOW, ".");
      SendClientMessage(playerid, COLOR_YELLOW, ".");
      SendClientMessage(playerid, COLOR_YELLOW, "!");
      return 1;
    }
    return 0;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if (PRESSED(KEY_SUBMISSION))
	{
	new veh = GetPlayerVehicleID(playerid);
	if(veh == bus3 || veh == bus2 || veh == bus1)
    {
      busdriver = 1;
      SetPlayerCheckpoint(playerid, buspoint1, 3.0);
      GameTextForPlayer(playerid, "~g~Bus Driver Started!", 3000, 3);
      new name[MAX_PLAYER_NAME], string[48];
      GetPlayerName(playerid, name, sizeof(name));
      format(string, sizeof(string), "%s Is Now A Bus Driver!.", name );
      SendClientMessageToAll(LIME, string);
      return 1;
      }
 	SendClientMessage(playerid, COLOR_RED,"You Have To Be In A Bus To Start The Mission!");
    }
	return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
new veh = GetPlayerVehicleID(playerid);
if(veh == bus3 || veh == bus2 || veh == bus1)
  {
   if (IsPlayerInRangeOfPoint(playerid, 10.0,buspoint1))
   {
     SetPlayerCheckpoint(playerid, buspoint2, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The San Fierro Train Station, Received 500$");
     GivePlayerMoney(playerid, 500);
     }
   if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint2))
   {
     SetPlayerCheckpoint(playerid, buspoint3, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The Cluckin Bell, Received 500$");
     GivePlayerMoney(playerid, 500);
     }
   if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint3))
   {
     SetPlayerCheckpoint(playerid, buspoint4, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The Police Station, Received 500$");
     GivePlayerMoney(playerid, 500);
     }
   if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint4))
   {
     SetPlayerCheckpoint(playerid, buspoint5, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The San Fierro Bank, Received 500$");
     GivePlayerMoney(playerid, 500);
     }
   if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint5))
   {
     SetPlayerCheckpoint(playerid, buspoint6, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The Burger Shot, Received 500$");
     GivePlayerMoney(playerid, 500);
     }
   if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint6))
   {
     SetPlayerCheckpoint(playerid, buspoint7, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At Ammunation, Received 500$");
     GivePlayerMoney(playerid, 500);
     }
   if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint7))
   {
     SetPlayerCheckpoint(playerid, buspoint8, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The , Received 500$");
     GivePlayerMoney(playerid, 500);
     }
   if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint8))
   {
     SetPlayerCheckpoint(playerid, buspoint9, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At , Received 500$");
     GivePlayerMoney(playerid, 500);
     }
   if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint9))
   {
     SetPlayerCheckpoint(playerid, buspoint10, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The Don's RubberShop, Received 500$");
     GivePlayerMoney(playerid, 500);
     }
   if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint10))
   {
     	SendClientMessage(playerid, LIME,"Type /Start Again To Start The BusDriver Mission!");
     	GivePlayerMoney(playerid, 500);
     	DisablePlayerCheckpoint(playerid);
  			busdriver = 0;
   }
  }
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
   new veh = GetPlayerVehicleID(playerid);
	 if(veh == bus3 || veh == bus2 || veh == bus1)
   {
     SendClientMessage(playerid, YELLOW, "START THE BUS MISSION BY PRESSING 2");
     GameTextForPlayer(playerid, "~y~START THE BUS DRIVER MISSION BY~n~~b~PRESSING 2!",3000,3);
   }
	 return 0;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if((busdriver) == 1)
    {
    	busdriver= 0;
   		SendClientMessage(playerid, COLOR_RED, "You left your Busbehind, get in again if you want to continue your job.");

    }else if((busdriver) == 0){

        //Nothing
 }
}
public OnPlayerDeath(playerid, killerid, reason)
{
     DisablePlayerCheckpoint(playerid);
     busdriver = 0;
     return 1;
}
Reply
#2

Be honest, you counted a million key presses?

Quote:
Originally Posted by Kar
hey i made this and when you enter one of the buses you can do press 2 a million times and the bus driver mission will start? i dont want that. and when i get to the second checkpoint nothing happens D: (o and when i entervehicle its surpose to say the gametext but it doesn't>?)
Код:
#include <a_samp>

#define COLOR_DARKGOLD 0x808000AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define	YELLOW 0xFFFF00AA
#define LIME 0x00FF00FF

#define PRESSED(%0) \
	(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define HOLDING(%0) \
	((newkeys & (%0)) == (%0))
#define RELEASED(%0) \
	(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))

#define buspoint1 -1998.7400,174.6382,27.6473
#define buspoint2 -1805.8813,600.1848,34.8620
#define buspoint3 -1601.1205,726.2743,11.1720
#define buspoint4 -1612.7714,857.1121,7.6761
#define buspoint5 -1766.0300,935.1175,24.8755
#define buspoint6 -1904.0560,811.3516,36.1556
#define buspoint7 -2648.9529,570.7150,14.5943
#define buspoint8 -2614.7012,215.6137,5.2519
#define buspoint9 -2150.6584,148.2724,35.3053
#define buspoint10 -2061.5159,-74.0719,34.8552

new bus1;
new bus2;
new bus3;
new busdriver = 0;

public OnFilterScriptInit()
{
bus1 = AddStaticVehicle(431,-1988.7975,192.1375,27.6358,359.7323,75,59); // bus1
bus2 =	AddStaticVehicle(431,-1988.8607,178.5440,27.6378,359.7324,75,59); // bus2
bus3 =	AddStaticVehicle(431,-1988.9200,165.7481,27.6426,359.7370,75,59); // bus3

}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/start", cmdtext, true, 10) == 0)
    {
    new veh = GetPlayerVehicleID(playerid);
		if(veh == bus3 || veh == bus2 || veh == bus1)
    {
      busdriver = 1;
      SetPlayerCheckpoint(playerid, buspoint1, 3.0);
      GameTextForPlayer(playerid, "~g~Bus Driver Started!", 3000, 3);
      new name[MAX_PLAYER_NAME], string[48];
      GetPlayerName(playerid, name, sizeof(name));
      format(string, sizeof(string), "%s Is Now A Bus Driver!.", name );
      SendClientMessageToAll(COLOR_RED, string);
      return 1;
      }
    SendClientMessage(playerid, COLOR_RED,"You have to be in a busdriver van to start the job");
    }
    if (strcmp("/busdriverinfo", cmdtext, true, 10) == 0)
    {
      SendClientMessage(playerid, COLOR_YELLOW, ".");
      SendClientMessage(playerid, COLOR_YELLOW, ".");
      SendClientMessage(playerid, COLOR_YELLOW, ".");
      SendClientMessage(playerid, COLOR_YELLOW, "!");
      return 1;
    }
    return 0;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if (PRESSED(KEY_SUBMISSION))
	{
	new veh = GetPlayerVehicleID(playerid);
	if(veh == bus3 || veh == bus2 || veh == bus1)
    {
      busdriver = 1;
      SetPlayerCheckpoint(playerid, buspoint1, 3.0);
      GameTextForPlayer(playerid, "~g~Bus Driver Started!", 3000, 3);
      new name[MAX_PLAYER_NAME], string[48];
      GetPlayerName(playerid, name, sizeof(name));
      format(string, sizeof(string), "%s Is Now A Bus Driver!.", name );
      SendClientMessageToAll(LIME, string);
      return 1;
      }
 	SendClientMessage(playerid, COLOR_RED,"You Have To Be In A Bus To Start The Mission!");
    }
	return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
new veh = GetPlayerVehicleID(playerid);
if(veh == bus3 || veh == bus2 || veh == bus1)
 {
  if (IsPlayerInRangeOfPoint(playerid, 10.0,buspoint1))
  {
     SetPlayerCheckpoint(playerid, buspoint2, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The San Fierro Train Station, Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint2))
  {
     SetPlayerCheckpoint(playerid, buspoint3, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The Cluckin Bell, Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint3))
  {
     SetPlayerCheckpoint(playerid, buspoint4, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The Police Station, Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint4))
  {
     SetPlayerCheckpoint(playerid, buspoint5, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The San Fierro Bank, Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint5))
  {
     SetPlayerCheckpoint(playerid, buspoint6, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The Burger Shot, Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint6))
  {
     SetPlayerCheckpoint(playerid, buspoint7, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At Ammunation, Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint7))
  {
     SetPlayerCheckpoint(playerid, buspoint8, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The , Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint8))
  {
     SetPlayerCheckpoint(playerid, buspoint9, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At , Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint9))
  {
     SetPlayerCheckpoint(playerid, buspoint10, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The Don's RubberShop, Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint10))
  {
     	SendClientMessage(playerid, LIME,"Type /Start Again To Start The BusDriver Mission!");
     	GivePlayerMoney(playerid, 500);
    	DisablePlayerCheckpoint(playerid);
 			busdriver = 0;
  }
 }
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  new veh = GetPlayerVehicleID(playerid);
	 if(veh == bus3 || veh == bus2 || veh == bus1)
  {
    SendClientMessage(playerid, YELLOW, "START THE BUS MISSION BY PRESSING 2");
    GameTextForPlayer(playerid, "~y~START THE BUS DRIVER MISSION BY~n~~b~PRESSING 2!",3000,3);
  }
	 return 0;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if((busdriver) == 1)
    {
    	busdriver= 0;
   		SendClientMessage(playerid, COLOR_RED, "You left your Busbehind, get in again if you want to continue your job.");

    }else if((busdriver) == 0){

        //Nothing
 }
}
public OnPlayerDeath(playerid, killerid, reason)
{
     DisablePlayerCheckpoint(playerid);
     busdriver = 0;
     return 1;
}
Reply
#3

no i pressed it like 7 times and the mission kept starting over its just an expression.
Reply
#4

Quote:
Originally Posted by Kar
no i pressed it like 7 times and the mission kept starting over its just an expression.
Sarcasm to be correct
Reply
#5

Quote:
Originally Posted by ToPhrESH
Quote:
Originally Posted by Kar
no i pressed it like 7 times and the mission kept starting over its just an expression.
Sarcasm to be correct
ok.. could someone help me now>.<
Reply
#6

Quote:
Originally Posted by Kar
hey i made this and when you enter one of the buses you can do press 2 a million times and the bus driver mission will start? i dont want that. and when i get to the second checkpoint nothing happens D: (o and when i entervehicle its surpose to say the gametext but it doesn't>?)
Код:
#include <a_samp>

#define COLOR_DARKGOLD 0x808000AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define	YELLOW 0xFFFF00AA
#define LIME 0x00FF00FF

#define PRESSED(%0) \
	(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define HOLDING(%0) \
	((newkeys & (%0)) == (%0))
#define RELEASED(%0) \
	(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))

#define buspoint1 -1998.7400,174.6382,27.6473
#define buspoint2 -1805.8813,600.1848,34.8620
#define buspoint3 -1601.1205,726.2743,11.1720
#define buspoint4 -1612.7714,857.1121,7.6761
#define buspoint5 -1766.0300,935.1175,24.8755
#define buspoint6 -1904.0560,811.3516,36.1556
#define buspoint7 -2648.9529,570.7150,14.5943
#define buspoint8 -2614.7012,215.6137,5.2519
#define buspoint9 -2150.6584,148.2724,35.3053
#define buspoint10 -2061.5159,-74.0719,34.8552

new bus1;
new bus2;
new bus3;
new busdriver = 0;

public OnFilterScriptInit()
{
bus1 = AddStaticVehicle(431,-1988.7975,192.1375,27.6358,359.7323,75,59); // bus1
bus2 =	AddStaticVehicle(431,-1988.8607,178.5440,27.6378,359.7324,75,59); // bus2
bus3 =	AddStaticVehicle(431,-1988.9200,165.7481,27.6426,359.7370,75,59); // bus3

}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/start", cmdtext, true, 10) == 0)
    {
    new veh = GetPlayerVehicleID(playerid);
		if(veh == bus3 || veh == bus2 || veh == bus1)
    {
      busdriver = 1;
      SetPlayerCheckpoint(playerid, buspoint1, 3.0);
      GameTextForPlayer(playerid, "~g~Bus Driver Started!", 3000, 3);
      new name[MAX_PLAYER_NAME], string[48];
      GetPlayerName(playerid, name, sizeof(name));
      format(string, sizeof(string), "%s Is Now A Bus Driver!.", name );
      SendClientMessageToAll(COLOR_RED, string);
      return 1;
      }
    SendClientMessage(playerid, COLOR_RED,"You have to be in a busdriver van to start the job");
    }
    if (strcmp("/busdriverinfo", cmdtext, true, 10) == 0)
    {
      SendClientMessage(playerid, COLOR_YELLOW, ".");
      SendClientMessage(playerid, COLOR_YELLOW, ".");
      SendClientMessage(playerid, COLOR_YELLOW, ".");
      SendClientMessage(playerid, COLOR_YELLOW, "!");
      return 1;
    }
    return 0;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if (PRESSED(KEY_SUBMISSION))
	{
	new veh = GetPlayerVehicleID(playerid);
	if(veh == bus3 || veh == bus2 || veh == bus1)
    {
      busdriver = 1;
      SetPlayerCheckpoint(playerid, buspoint1, 3.0);
      GameTextForPlayer(playerid, "~g~Bus Driver Started!", 3000, 3);
      new name[MAX_PLAYER_NAME], string[48];
      GetPlayerName(playerid, name, sizeof(name));
      format(string, sizeof(string), "%s Is Now A Bus Driver!.", name );
      SendClientMessageToAll(LIME, string);
      return 1;
      }
 	SendClientMessage(playerid, COLOR_RED,"You Have To Be In A Bus To Start The Mission!");
    }
	return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
new veh = GetPlayerVehicleID(playerid);
if(veh == bus3 || veh == bus2 || veh == bus1)
 {
  if (IsPlayerInRangeOfPoint(playerid, 10.0,buspoint1))
  {
     SetPlayerCheckpoint(playerid, buspoint2, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The San Fierro Train Station, Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint2))
  {
     SetPlayerCheckpoint(playerid, buspoint3, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The Cluckin Bell, Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint3))
  {
     SetPlayerCheckpoint(playerid, buspoint4, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The Police Station, Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint4))
  {
     SetPlayerCheckpoint(playerid, buspoint5, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The San Fierro Bank, Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint5))
  {
     SetPlayerCheckpoint(playerid, buspoint6, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The Burger Shot, Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint6))
  {
     SetPlayerCheckpoint(playerid, buspoint7, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At Ammunation, Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint7))
  {
     SetPlayerCheckpoint(playerid, buspoint8, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The , Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint8))
  {
     SetPlayerCheckpoint(playerid, buspoint9, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At , Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint9))
  {
     SetPlayerCheckpoint(playerid, buspoint10, 10.0);
     SendClientMessage(playerid, LIME,"Arrived At The Don's RubberShop, Received 500$");
     GivePlayerMoney(playerid, 500);
    }
  if (IsPlayerInRangeOfPoint(playerid, 7.0,buspoint10))
  {
     	SendClientMessage(playerid, LIME,"Type /Start Again To Start The BusDriver Mission!");
     	GivePlayerMoney(playerid, 500);
    	DisablePlayerCheckpoint(playerid);
 			busdriver = 0;
  }
 }
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  new veh = GetPlayerVehicleID(playerid);
	 if(veh == bus3 || veh == bus2 || veh == bus1)
  {
    SendClientMessage(playerid, YELLOW, "START THE BUS MISSION BY PRESSING 2");
    GameTextForPlayer(playerid, "~y~START THE BUS DRIVER MISSION BY~n~~b~PRESSING 2!",3000,3);
  }
	 return 0;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if((busdriver) == 1)
    {
    	busdriver= 0;
   		SendClientMessage(playerid, COLOR_RED, "You left your Busbehind, get in again if you want to continue your job.");

    }else if((busdriver) == 0){

        //Nothing
 }
}
public OnPlayerDeath(playerid, killerid, reason)
{
     DisablePlayerCheckpoint(playerid);
     busdriver = 0;
     return 1;
}
Try this:

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(!ispassenger){
    if(vehicleid == bus3 || vehicleid == bus2 || vehicleid == bus1)
    {
      SendClientMessage(playerid, YELLOW, "START THE BUS MISSION BY PRESSING 2");
      GameTextForPlayer(playerid, "~y~START THE BUS DRIVER MISSION BY~n~~b~PRESSING 2!",3000,3);
    }
  }
  return 0;
}
What is it exactly that you want the "2" button to do?
Reply
#7

Make a variable like this:
Код:
IsBusJob[MAX_PLAYERS];
Then on OnPlayerKeyStateChange:

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if (newkeys==KEY_SUBMISSION && IsBusJob[playerid] == 0 && veh == bus1) // checks if Submission key is pressed + if the player is already working + that the player is in a bus
	{
	  SendClientMessage(playerid, green, "You started working for the bus company!"); // SCM only one time cause the variable under here.
	  IsBusJob[playerid] = 1; // here's the variable set to 1, this will prevent the player from starting working over again.
	}
- It's not a full code, it is for you so you can read and understand it then go ahead and code it yourself!
Reply
#8

thx can anyone help with the cp now
Reply
#9

make MinRand search after it then:

Код:
new random;
random = minrand(1,5)
if (random == 1) location 1;
else if (random == 2) location 2;
else if (random == 3) location 3;
else if (random == 4) location 4;
else if (random == 5) location 5;
again not a full code but im sure you get the point!
Reply
#10

Код:
new random;
random = minrand(1,10)
if (random == 1) buspoint1;
else if (random == 2) buspoint2;
else if (random == 3) buspoint3;
else if (random == 4) buspoint4;
else if (random == 5) buspoint5;
else if (random == 5) buspoint6;
else if (random == 2) buspoint7;
else if (random == 3) buspoint8;
else if (random == 4) buspoint9;
else if (random == 5) buspoint10;
looks right to you?
and where should i put it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)