Taxi Script help
#1

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);
                }
            }
        }
    }
}
Reply
#2

anyone at all ?
Reply
#3

anyone ?
Reply
#4

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...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)