26.03.2015, 22:58
Hi all, can some one tell me how to change the default CameraSpawn of samp ? :
ClassSel_SetupCharSelection(playerid)
{
if(gPlayerCitySelection[playerid] == CITY_LOS_SANTOS)
{
SetPlayerInterior(playerid,11);
SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
SetPlayerFacingAngle(playerid,0.0);
SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);
}
else if(gPlayerCitySelection[playerid] == CITY_SAN_FIERRO) {
SetPlayerInterior(playerid,3);
SetPlayerPos(playerid,-2673.8381,1399.7424,918.3516);
SetPlayerFacingAngle(playerid,181.0);
SetPlayerCameraPos(playerid,-2673.2776,1394.3859,918.3516);
SetPlayerCameraLookAt(playerid,-2673.8381,1399.7424,918.3516);
}
else if(gPlayerCitySelection[playerid] == CITY_LAS_VENTURAS) {
SetPlayerInterior(playerid,3);
SetPlayerPos(playerid,349.0453,193.2271,1014.1797);
SetPlayerFacingAngle(playerid,286.25);
SetPlayerCameraPos(playerid,352.9164,194.5702,1014.1875);
SetPlayerCameraLookAt(playerid,349.0453,193.2271,1014.1797);
}
}
OnPlayerRequestClass(playerid, classid)
// This callback gets called when the player is selecting a class (but hasn't clicked "Spawn" yet) public OnPlayerRequestClass(playerid, classid) { SetPlayerInterior(playerid,2); SetPlayerPos(playerid,1524.509887,-46.821197,1002.130981); SetPlayerFacingAngle(playerid, 145.0); SetPlayerCameraPos(playerid,1521.509887,-49.821197,1002.7); SetPlayerCameraLookAt(playerid,1523.509887,-47.821197,1002.6); // Display a short message to inform the player about the class he's about to choose switch (classid) { case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10: // Classes that will be truckdrivers { // Display the name of the class GameTextForPlayer(playerid, TXT_ClassTrucker, 3000, 4); // Store the class for the player (truckdriver) APlayerData[playerid][PlayerClass] = ClassTruckDriver; } case 11, 12, 13: // Classes that will be bus-drivers { // Display the name of the class GameTextForPlayer(playerid, TXT_ClassBusDriver, 3000, 4); // Store the class for the player (busdriver) APlayerData[playerid][PlayerClass] = ClassBusDriver; } case 14, 15, 16, 17, 18: // Classes that will be Pilot { // Display the name of the class GameTextForPlayer(playerid, TXT_ClassPilot, 3000, 4); // Store the class for the player (pilot) APlayerData[playerid][PlayerClass] = ClassPilot; } case 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29: // Classes that will be police { // Display the name of the class GameTextForPlayer(playerid, TXT_ClassPolice, 3000, 4); // Store the class for the player (police) APlayerData[playerid][PlayerClass] = ClassPolice; } case 30, 31, 32, 33, 34: // Classes that will be mafia { // Display the name of the class GameTextForPlayer(playerid, TXT_ClassMafia, 3000, 4); // Store the class for the player (mafia) APlayerData[playerid][PlayerClass] = ClassMafia; } case 35, 36, 37: // Classes that will be courier { // Display the name of the class GameTextForPlayer(playerid, TXT_ClassCourier, 3000, 4); // Store the class for the player (courier) APlayerData[playerid][PlayerClass] = ClassCourier; } case 38, 39, 40, 41, 42: // Classes that will be roadworker { // Display the name of the class GameTextForPlayer(playerid, TXT_ClassRoadWorker, 3000, 4); // Store the class for the player (roadworker) APlayerData[playerid][PlayerClass] = ClassRoadWorker; } } return 1; }
// This callback gets called when a player connects to the server public OnPlayerConnect(playerid) { // Always allow NPC's to login without password or account PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/lbw4uep6fa/Musique.mp3"); if (IsPlayerNPC(playerid)) return 1; // Setup local variables new Name[MAX_PLAYER_NAME], NewPlayerMsg[128], HouseID; RemoveBuildingForPlayer(playerid, 8229, 0.0, 0.0, 0.0, 6000.0); RemoveBuildingForPlayer(playerid, 11014, 0.0, 0.0, 0.0, 6000.0); RemoveBuildingForPlayer(playerid, 11372, 0, 0, 0, 6000.0); // BANQUE PAR BLACK // Setup a PVar to allow cross-script money-transfers (only from filterscript to this mainscript) and scorepoints SetPVarInt(playerid, "PVarMoney", 0); SetPVarInt(playerid, "PVarScore", 0); // Get the playername GetPlayerName(playerid, Name, sizeof(Name)); // Also store this name for the player GetPlayerName(playerid, APlayerData[playerid][PlayerName], 24); // Send a message to all players to let them know somebody else joined the server format(NewPlayerMsg, 128, TXT_PlayerJoinedServer, Name, playerid); SendClientMessageToAll(0xFFFFFFFF, NewPlayerMsg); // Try to load the player's datafile ("PlayerFile_Load" returns "1" is the file has been read, "0" when the file cannot be read) if (PlayerFile_Load(playerid) == 1) { // Check if the player is still banned if (APlayerData[playerid][BanTime] < gettime()) // Player ban-time is passed ShowPlayerDialog(playerid, DialogLogin, DIALOG_STYLE_PASSWORD, TXT_DialogLoginTitle, TXT_DialogLoginMsg, TXT_DialogLoginButton1, TXT_DialogButtonCancel); else // Player is still banned { ShowRemainingBanTime(playerid); // Show the remaining ban-time to the player is days, hours, minutes, seconds Kick(playerid); // Kick the player } } else { new strStartRules[2000]; // Construct the rules format(strStartRules, 2000, "%s1. Avoir une conduire propre, ne gйnant pas les autres joueurs.\n", strStartRules); format(strStartRules, 2000, "%s2. Avoir un comportement irrйprochable envers les joueurs et le staff.\n", strStartRules); format(strStartRules, 2000, "%s3. La langue principale est le franзais.\n", strStartRules); format(strStartRules, 2000, "%s4. L'utilisation d'un logiciel de cheat est formellement interdit.\n", strStartRules); format(strStartRules, 2000, "%s5. L'utilisation d'un bug vous donnant des avantages est йgalement interdit.\n", strStartRules); format(strStartRules, 2000, "%s6. Ne pas spammer le chat.\n", strStartRules); format(strStartRules, 2000, "%s7. Ne pas demander а devenir admin, а avoir une maison, un business, un dйpфt, de l'argent.\n", strStartRules); format(strStartRules, 2000, "%s8. Ne pas gкner les joueurs sur la route.\n", strStartRules); ShowPlayerDialog(playerid, DialogStartRules, DIALOG_STYLE_MSGBOX, "Rиglement du serveur", strStartRules, "Refuser", "Accepter"); } // The houses have been loaded but not the cars, so load all vehicles assigned to the player's houses for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++) { // Get the HouseID from this slot HouseID = APlayerData[playerid][Houses][HouseSlot]; // Check if there is a house in this slot if (HouseID != 0) HouseFile_Load(HouseID, true); // Load the cars of the house } // Speedometer setup Speedometer_Setup(playerid); TextDrawShowForPlayer(playerid,welcomeText); TextDrawShowForPlayer(playerid,infoText); // MissionText TextDraw setup APlayerData[playerid][MissionText] = TextDrawCreate(320.0, 430.0, " "); // Setup the missiontext at the bottom of the screen TextDrawAlignment(APlayerData[playerid][MissionText], 2); // Align the missiontext to the center TextDrawUseBox(APlayerData[playerid][MissionText], 1); // Set the missiontext to display inside a box TextDrawBoxColor(APlayerData[playerid][MissionText], 0x00000066); // Set the box color of the missiontext // Display a message if the player hasn't accepted the rules yet if (APlayerData[playerid][RulesRead] == false) SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Vous n'avez pas encore confirmй que vous acceptez le reglement {FFFF00}/regles{FF0000}."); return 1; } // This function shows the player how long his ban still is when he tries to login (in days, hours, minutes, seconds) ShowRemainingBanTime(playerid) { // Setup local variables new TotalBanTime, Days, Hours, Minutes, Seconds, Msg[128]; // Get the total ban-time TotalBanTime = APlayerData[playerid][BanTime] - gettime(); // Calculate days if (TotalBanTime >= 86400) { Days = TotalBanTime / 86400; TotalBanTime = TotalBanTime - (Days * 86400); } // Calculate hours if (TotalBanTime >= 3600) { Hours = TotalBanTime / 3600; TotalBanTime = TotalBanTime - (Hours * 3600); } // Calculate minutes if (TotalBanTime >= 60) { Minutes = TotalBanTime / 60; TotalBanTime = TotalBanTime - (Minutes * 60); } // Calculate seconds Seconds = TotalBanTime; // Display the remaining ban-time for this player SendClientMessage(playerid, 0xFFFFFFFF, TXT_StillBanned); format(Msg, 128, TXT_BannedDuration, Days, Hours, Minutes, Seconds); SendClientMessage(playerid, 0xFFFFFFFF, Msg); } //Raison du joueur quand il se deconnecte public OnPlayerDisconnect(playerid, reason) { new szString[64], playerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); new szDisconnectReason[3][] = { "Cnx Perdue/Crash", "Quitter", "Kick/Ban" }; format(szString, sizeof szString, "%s а quitter Ultimate Trucking Server (%s).", playerName, szDisconnectReason[reason]); SendClientMessageToAll(0xC4C4C4FF, szString); // Always allow NPC's to logout without password or account if (IsPlayerNPC(playerid)) return 1; // Setup local variables new Name[24], Msg[128], HouseID; // Get the playername GetPlayerName(playerid, Name, sizeof(Name)); // Stop spectate mode for all players who are spectating this player for (new i; i < MAX_PLAYERS; i++) if (IsPlayerConnected(i)) // Check if the player is connected if (GetPlayerState(i) == PLAYER_STATE_SPECTATING) // Check if this player is spectating somebody if (APlayerData[i][SpectateID] == playerid) // Check if this player is spectating me { TogglePlayerSpectating(i, 0); // Turn off spectate-mode APlayerData[i][SpectateID] = INVALID_PLAYER_ID; APlayerData[i][SpectateType] = ADMIN_SPEC_TYPE_NONE; SendClientMessage(i, 0xFFFFFFFF, "{FF0000}Le joueur s'est dйconnectй, fin du mode spectateur"); } // Send a message to all players to let them know somebody left the server format(Msg, 128, Name, playerid); SendClientMessageToAll(0xFFFFFFFF, Msg); // If the player entered a proper password (the player has an account) if (strlen(APlayerData[playerid][PlayerPassword]) != 0) { // Save the player data and his houses PlayerFile_Save(playerid); } // Stop any job that may have started (this also clears all mission data) switch (APlayerData[playerid][PlayerClass]) { case ClassTruckDriver: Trucker_EndJob(playerid); // Stop any trucker job case ClassBusDriver: BusDriver_EndJob(playerid); // Stop any busdriver job case ClassPilot: Pilot_EndJob(playerid); // Stop any pilot job case ClassPolice: Police_EndJob(playerid); // Stop any police job case ClassMafia: Mafia_EndJob(playerid); // Stop any mafia job case ClassRoadWorker: Roadworker_EndJob(playerid); } // If the player is part of a convoy, kick him from it Convoy_Leave(playerid); // Unload all the player's house-vehicles to make room for other player's vehicles for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++) { // Get the HouseID from this slot HouseID = APlayerData[playerid][Houses][HouseSlot]; // Check if there is a house in this slot if (HouseID != 0) { // Unload the cars of the house House_RemoveVehicles(HouseID); // Set the house so it cannot be entered by anyone (close the house) AHouseData[HouseID][HouseOpened] = false; } } // Clear the data in the APlayerData array to make sure the next player with the same id doesn't hold wrong data APlayerData[playerid][SpectateID] = -1; APlayerData[playerid][SpectateVehicle] = -1; APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_NONE; APlayerData[playerid][LoggedIn] = false; APlayerData[playerid][PlayerPassword] = 0; APlayerData[playerid][PlayerLevel] = 0; APlayerData[playerid][VIPLevel] = 0; APlayerData[playerid][PlayerJailed] = 0; APlayerData[playerid][PlayerFrozen] = 0; // Clearing this variable automatically kills the frozentimer APlayerData[playerid][Bans] = 0; APlayerData[playerid][BanTime] = 0; APlayerData[playerid][Muted] = false; APlayerData[playerid][RulesRead] = false; APlayerData[playerid][AutoReportTime] = 0; APlayerData[playerid][TruckerLicense] = 0; APlayerData[playerid][BusLicense] = 0; APlayerData[playerid][PlayerClass] = 0; APlayerData[playerid][Warnings] = 0; APlayerData[playerid][PlayerMoney] = 0; APlayerData[playerid][PlayerScore] = 0; for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++) APlayerData[playerid][Houses][HouseSlot] = 0; for (new BusSlot; BusSlot < MAX_BUSINESSPERPLAYER; BusSlot++) APlayerData[playerid][Business][BusSlot] = 0; APlayerData[playerid][CurrentHouse] = 0; // Clear bank account info APlayerData[playerid][BankPassword] = 0; APlayerData[playerid][BankLoggedIn] = false; APlayerData[playerid][BankMoney] = 0; // Clear stats APlayerData[playerid][StatsTruckerJobs] = 0; APlayerData[playerid][StatsConvoyJobs] = 0; APlayerData[playerid][StatsBusDriverJobs] = 0; APlayerData[playerid][StatsPilotJobs] = 0; APlayerData[playerid][StatsMafiaJobs] = 0; APlayerData[playerid][StatsMafiaStolen] = 0; APlayerData[playerid][StatsPoliceFined] = 0; APlayerData[playerid][StatsPoliceJailed] = 0; APlayerData[playerid][StatsCourierJobs] = 0; APlayerData[playerid][StatsRoadworkerJobs] = 0; APlayerData[playerid][StatsMetersDriven] = 0.0; // Clear police warnings APlayerData[playerid][PoliceCanJailMe] = false; APlayerData[playerid][PoliceWarnedMe] = false; APlayerData[playerid][Value_PoliceCanJailMe] = 0; // Make sure the jailtimer has been destroyed KillTimer(APlayerData[playerid][PlayerJailedTimer]); KillTimer(APlayerData[playerid][Timer_PoliceCanJailMe]); // Destroy the speedometer TextDraw for this player and the timer, also set the speed to 0 Speedometer_Cleanup(playerid); // Also destroy the missiontext TextDraw for this player TextDrawDestroy(APlayerData[playerid][MissionText]); // Destroy a rented vehicle is the player had any if (APlayerData[playerid][RentedVehicleID] != 0) { // Clear the data for the already rented vehicle AVehicleData[APlayerData[playerid][RentedVehicleID]][Model] = 0; AVehicleData[APlayerData[playerid][RentedVehicleID]][Fuel] = 0; AVehicleData[APlayerData[playerid][RentedVehicleID]][Owned] = false; AVehicleData[APlayerData[playerid][RentedVehicleID]][Owner] = 0; AVehicleData[APlayerData[playerid][RentedVehicleID]][PaintJob] = 0; for (new j; j < 14; j++) { AVehicleData[APlayerData[playerid][RentedVehicleID]][Components][j] = 0; } // Destroy the vehicle DestroyVehicle(APlayerData[playerid][RentedVehicleID]); // Clear the RentedVehicleID APlayerData[playerid][RentedVehicleID] = 0; } return 1; } // This callback gets called whenever a player uses the chat-box public OnPlayerText(playerid, text[]) { // Block the player's text if he has been muted if (APlayerData[playerid][Muted] == true) { // Let the player know he's still muted SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Vous etes toujours muet"); // Don't allow his text to be sent to the chatbox return 0; } return 1; }