12.11.2013, 03:15
Code:
switch (APlayerData[playerid][PlayerClass]) { case ClassTruckDriver: // Truck-driver class { TextDrawDestroy(Textdraw2); format(missiontext, sizeof(missiontext), Trucker_NoJobText); // Preset the missiontext SetPlayerColor(playerid, ColorClassTruckDriver); // Set the playercolor (chatcolor for the player and color on the map) } case ClassBusDriver: // Bus-driver class { TextDrawDestroy(Textdraw2); format(missiontext, sizeof(missiontext), BusDriver_NoJobText); // Preset the missiontext SetPlayerColor(playerid, ColorClassBusDriver); // Set the playercolor (chatcolor for the player and color on the map) } case ClassPilot: // Pilot class { TextDrawShowForPlayer(playerid, Textdraw2); format(missiontext, sizeof(missiontext), Pilot_NoJobText); // Preset the missiontext SetPlayerColor(playerid, ColorClassPilot); // Set the playercolor (chatcolor for the player and color on the map) } case ClassPolice: // Police class { TextDrawDestroy(Textdraw2); format(missiontext, sizeof(missiontext), Police_NoJobText); // Preset the missiontext SetPlayerColor(playerid, ColorClassPolice); // Set the playercolor (chatcolor for the player and color on the map) // Start the PlayerCheckTimer to scan for wanted players (be sure the timer has been destroyed first) KillTimer(APlayerData[playerid][PlayerCheckTimer]); APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Police_CheckWantedPlayers", 1000, true, "i", playerid); // Check if the police player can get weapons if (PoliceGetsWeapons == true) { // Give up to 12 weapons to the player for (new i; i < 12; i++) GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo); } } case ClassMafia: // Mafia class { TextDrawDestroy(Textdraw2); format(missiontext, sizeof(missiontext), Mafia_NoJobText); // Preset the missiontext SetPlayerColor(playerid, ColorClassMafia); // Set the playercolor (chatcolor for the player and color on the map) // Start the PlayerCheckTimer to scan for players that carry mafia-loads (be sure the timer has been destroyed first) KillTimer(APlayerData[playerid][PlayerCheckTimer]); APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Mafia_CheckMafiaLoads", 1000, true, "i", playerid); } case ClassCourier: // Courier class { TextDrawDestroy(Textdraw2); format(missiontext, sizeof(missiontext), Courier_NoJobText); // Preset the missiontext SetPlayerColor(playerid, ColorClassCourier); // Set the playercolor (chatcolor for the player and color on the map) } case ClassAssistance: // Assistance class { TextDrawDestroy(Textdraw2); format(missiontext, sizeof(missiontext), Assistance_NoJobText); // Preset the missiontext SetPlayerColor(playerid, ColorClassAssistance); // Set the playercolor (chatcolor for the player and color on the map) // Start the PlayerCheckTimer to scan for players who need assistance (be sure the timer has been destroyed first) KillTimer(APlayerData[playerid][PlayerCheckTimer]); APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Assistance_CheckPlayers", 1000, true, "i", playerid); } case ClassRoadWorker: // Roadworker class { TextDrawDestroy(Textdraw2); format(missiontext, sizeof(missiontext), RoadWorker_NoJobText); // Preset the missiontext SetPlayerColor(playerid, ColorClassRoadWorker); // Set the playercolor (chatcolor for the player and color on the map) } } // Set the missiontext TextDrawSetString(APlayerData[playerid][MissionText], missiontext); // Show the missiontext for this player TextDrawShowForPlayer(playerid, APlayerData[playerid][MissionText]); // If the player spawns and his jailtime hasn't passed yet, put him back in jail if (APlayerData[playerid][PlayerJailed] != 0) Police_JailPlayer(playerid, APlayerData[playerid][PlayerJailed]); return 1; }
when we find pilot class than this textdraw will show. and if we don't select/change the class from pilot than it will hide/destroy textdraw.