What will be the outcome?
#1

If I do this specific loop:
pawn Code:
for(new i; i<MAX_PLAYERS; i++)
{
   if(IsPlayerInVehicle(i, IsATaxi(GetPlayerVehicleID(i))) && newstate == PLAYER_STATE_DRIVER)
   {
     return GivePlayerCash(i, 20);
   }
}
My IsATaxi function:
pawn Code:
public IsATaxi(vehicleid)
{  
   new model = GetVehicleModel(vehicleid);
   if(model == 420)
   {
     return 1;
   }
   return 0;
}
Will this give every driver that is currently in a taxi $20 or just the one the passenger enters.

Whole section of desired code:
pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
   if(newstate == PLAYER_STATE_PASSENGER)
   {
     if(PlayerInfo[playerid][pCalledTaxi] == 1 && IsATaxi(GetPlayerVehicleID(playerid)))
     {
        GivePlayerCash(playerid, -20);
        PlayerInfo[playerid][pCalledTaxi] = 0;
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You entered the taxi which you called for, this ride has cost you $20.");
        for(new i; i<MAX_PLAYERS; i++)
        {
          if(IsPlayerInVehicle(i, IsATaxi(GetPlayerVehicleID(i))) && newstate == PLAYER_STATE_DRIVER)
          {
             return GivePlayerCash(i, 20);
          }
        }
and so on..
Reply


Messages In This Thread
What will be the outcome? - by Lewwy - 12.04.2009, 22:37
Re: What will be the outcome? - by Pyrokid - 12.04.2009, 22:50
Re: What will be the outcome? - by Norn - 12.04.2009, 23:06
Re: What will be the outcome? - by Burridge - 12.04.2009, 23:15
Re: What will be the outcome? - by Lewwy - 13.04.2009, 11:18
Re: What will be the outcome? - by FUNExtreme - 13.04.2009, 11:52
Re: What will be the outcome? - by Danut - 13.04.2009, 12:01
Re: What will be the outcome? - by Lewwy - 13.04.2009, 12:16
Re: What will be the outcome? - by Pyrokid - 13.04.2009, 12:24
Re: What will be the outcome? - by Danut - 13.04.2009, 12:48

Forum Jump:


Users browsing this thread: 1 Guest(s)