Taxi Missions - Problem
#1

Hi,

On this gamemode, people can go taxi drivers, when someone gets in, its suppose to say "you have one new passenger" for the player driving, but it says it for the actual passenger :P

here is the code:

if (newstate==PLAYER_STATE_PASSENGER)
{
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 431 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 437)
{
new i=0;
while (i<MAX_PLAYERS)
{
if ((playerInMiniMission[i]==1)&&(GetPlayerState(i)==PLAYER_STATE_DRIVER))
{
if (GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
{
new bdname[MAX_PLAYER_NAME];
GetPlayerName(i,bdname,MAX_PLAYER_NAME);
contador[i]++;
format(bdmsg,sizeof(bdmsg),"~w~You have gotten into ~n~~g~%s's ~r~Bus~w~",bdname);
GameTextForPlayer(playerid,bdmsg,3000,4);
format(bdmsg,sizeof(bdmsg),"~w~You have one new~n~~r~PASENGER~w~");
GameTextForPlayer(playerid,bdmsg,3000,4);
OnBusAsPassenger[playerid]=i;
CostoDelViaje[playerid]=BAJADA_DE_BANDERA;
if (cantidadPasajeros==0)
{
caidadefichaTimer=SetTimer("caidadeficha",30000,1) ;
}
cantidadPasajeros++;
i=MAX_PLAYERS;
}
}
i++;
}
}
Reply
#2

try replacing that with something like this:
Код:
if (newstate==PLAYER_STATE_PASSENGER)
 {
 if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 431 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 437)
 {
 new i=0;
 while (i<MAX_PLAYERS)
 {
 if ((playerInMiniMission[i]==1)&&(GetPlayerState(i)==PLAYER_STATE_DRIVER))
 {
 if (GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
 {
 new bdname[MAX_PLAYER_NAME];
 GetPlayerName(i,bdname,MAX_PLAYER_NAME);
 contador[i]++;
 format(bdmsg,sizeof(bdmsg),"~w~You have gotten into ~n~~g~%s's ~r~Bus~w~",bdname);
 GameTextForPlayer(playerid,bdmsg,3000,4);
 OnBusAsPassenger[playerid]=i;
 CostoDelViaje[playerid]=BAJADA_DE_BANDERA;
 if (cantidadPasajeros==0)
 {
 caidadefichaTimer=SetTimer("caidadeficha",30000,1) ;
 }
 cantidadPasajeros++;
 i=MAX_PLAYERS;
 }
 }
 i++;
 }
 }
else if (newstate==PLAYER_STATE_DRIVER)
 {
 if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 431 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 437)
 {
 new i=0;
 while (i<MAX_PLAYERS)
 {
 if ((playerInMiniMission[i]==1)&&(GetPlayerState(i)==PLAYER_STATE_DRIVER))
 {
 if (GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
 {
 new bdname[MAX_PLAYER_NAME];
 GetPlayerName(i,bdname,MAX_PLAYER_NAME);
 contador[i]++;
 format(bdmsg,sizeof(bdmsg),"~w~You have one new~n~~r~PASENGER~w~");
 GameTextForPlayer(playerid,bdmsg,3000,4);
 OnBusAsPassenger[playerid]=i;
 CostoDelViaje[playerid]=BAJADA_DE_BANDERA;
 if (cantidadPasajeros==0)
 {
 caidadefichaTimer=SetTimer("caidadeficha",30000,1) ;
 }
 cantidadPasajeros++;
 i=MAX_PLAYERS;
 }
 }
 i++;
 }
 }
Reply
#3

Ok I will try it, thanks
Reply
#4

Didn't quite work, but also how can I edit the code, so the fare is $20 * seconds in taxi?

Its currently fairly inefficient, as if you get in the taxi and hop right out, its automatically $200, which is just horrid.

I want it so, they hop in, timer starts, every second they are inside after the initial 5 seconds, goes up by $20, so, If it takes 1 minute to get where they're going, it will be $1800 when they exit..

But I also need to so if player in taxi < 5 seconds, then they dont pay - In the event some jumped in by mistake

If someone could help me out with this, would be awesome
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)