SA-MP Forums Archive
Taxi Script help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Taxi Script help (/showthread.php?tid=366186)



Taxi Script help - [LHT]Bally - 05.08.2012

Right The script i use works from all includes , i have the class set up and have the /taxi Command working so the player shows red tot he taxi driver , but how would i make it so that the taxi driver gets paid once the passenger gets out the car, The file is an .inc file

Thanks in advance

pawn Код:
//
forward Taxi_CheckPlayers(playerid);
public Taxi_CheckPlayers(playerid)
{
    // Scan through all players
    for (new PlayerToCheck; PlayerToCheck < MAX_PLAYERS; PlayerToCheck++)
    {
        // check if this player is connected
        if (IsPlayerConnected(PlayerToCheck))
        {
            //Check if that player needs assistance
            if (APlayerData[PlayerToCheck][TaxiNeeded] == true)
                SetPlayerMarkerForPlayer(playerid, PlayerToCheck, 0xFF0000FF); // Make that player red to the assistance-player
            else
            {
                // Reset the playercolor based on the player's class
                switch (APlayerData[PlayerToCheck][PlayerClass])
                {
                    case ClassTruckDriver: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassTruckDriver);
                    case ClassBusDriver: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassBusDriver);
                    case ClassPilot: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassPilot);
                    case ClassPolice: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassPolice);
                    case ClassMafia: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassMafia);
                    case ClassCourier: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassCourier);
                    case ClassAssistance: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassAssistance);
                }
            }
        }
    }
}



Re: Taxi Script help - [LHT]Bally - 05.08.2012

anyone at all ?


Re: Taxi Script help - [LHT]Bally - 06.08.2012

anyone ?


Re: Taxi Script help - CentyPoo - 06.08.2012

Use OnPlayerStateChange like this..

pawn Код:
if(newstate == PLAYER_STATE_ONFOOT)
{
     if(inTaxi[playerid] == 1) //set inTaxi to 1 when the player enters the taxi
     {
      //Your money command + messages
      inTaxi[playerid] = 0;
     }
}
You'll need this at the top of the script
pawn Код:
new inTaxi[MAX_PLAYERS];
Hope this helped...