lekpri 0 Odesláno: 5. Září, 2013 Share Odesláno: 5. Září, 2013 Ahoj. Mam problém v tom že auta ktere vložím do GM se nerozjedou. Jezdí auta pouze ty co jsou v GM ale ty co tam vložím já nejedou . Zajímave je, že v GM není ani jedno auto. Poradí někdo? Chtěl bych si do GM vložiz i svá auta. Děkuji za rady Link to comment Share on other sites More sharing options...
0 Globální moderátor Hip 191 Odesláno: 5. Září, 2013 Globální moderátor Share Odesláno: 5. Září, 2013 Jezdí auta pouze ty co jsou v GM ale ty co tam vložím já nejedou . Zajímave je, že v GM není ani jedno auto. máš moc pěknou fantazii Link to comment Share on other sites More sharing options...
0 lekpri 0 Odesláno: 5. Září, 2013 Author Share Odesláno: 5. Září, 2013 Ano aspoň já jsem žádné nenašel, například (AddStaticVehicle) Hip dík za radu Lidi co se chtěji jen posmívat nemusí reagovat. Jsem začátečník. Link to comment Share on other sites More sharing options...
0 Globální moderátor Hip 191 Odesláno: 5. Září, 2013 Globální moderátor Share Odesláno: 5. Září, 2013 Ano aspoň já jsem žádné nenašel, například (AddStaticVehicle) Hip dík za radu Lidi co se chtěji jen posmívat nemusí reagovat. Jsem začátečník. no jako docela dost mimo mluvíš .. jestli jsem dobře pochopil tak auta na serveru jsou ale nejsou v kodu? jestli jo tak já to pochopil jinak a zkus najít CreateVehicle to tam může být taky případně AddStaticVehicleEx... Link to comment Share on other sites More sharing options...
0 lekpri 0 Odesláno: 5. Září, 2013 Author Share Odesláno: 5. Září, 2013 Ano auta na serveru jsou ale v kodu ne. CreateVehicle ,, AddStaticVehicleEx tam není Já když vložím auto , příklad: AddStaticVehicle(567,1828.5138,-2127.2603,13.3257,1.4128,99,81); tak toto auto nejede Link to comment Share on other sites More sharing options...
0 Globální moderátor Hip 191 Odesláno: 5. Září, 2013 Globální moderátor Share Odesláno: 5. Září, 2013 a co tam máš nahraný za fs, includy případně pluginy? Link to comment Share on other sites More sharing options...
0 8eep 0 Odesláno: 5. Září, 2013 Share Odesláno: 5. Září, 2013 Tak to nerob cez AddStaticVehicle ale do módu si daj auta čo sú v Singli Kód: Include: #include "../include/gl_common.inc" #include "../include/gl_spawns.inc" OnGameModeInit public OnGameModeInit() { // SPECIAL total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/trains.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/pilots.txt"); // LAS VENTURAS total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt"); // SAN FIERRO total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_law.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_gen.txt"); // LOS SANTOS total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt"); // OTHER AREAS total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/whetstone.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/bone.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/flint.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/tierra.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/red_county.txt"); printf("Total vehicles from files: %d",total_vehicles_from_files); return 1; } Aspoň ja to tak mám v móde Link to comment Share on other sites More sharing options...
0 lekpri 0 Odesláno: 5. Září, 2013 Author Share Odesláno: 5. Září, 2013 Ve fs mám : gl_actions gl_realtime a plug... : sscanf streamer Link to comment Share on other sites More sharing options...
0 8eep 0 Odesláno: 5. Září, 2013 Share Odesláno: 5. Září, 2013 Skús použiť to čo som napísal Link to comment Share on other sites More sharing options...
0 lekpri 0 Odesláno: 5. Září, 2013 Author Share Odesláno: 5. Září, 2013 To mě nejde Nikdo neví v čem je problém ? Moc prosím poraďte Link to comment Share on other sites More sharing options...
0 DooM 93 Odesláno: 5. Září, 2013 Share Odesláno: 5. Září, 2013 Dáváš ta auta do public OnFilterScriptInit? a pak ten FS nahraješ na server do složky Filterscripts a zapíšeš ho do configu? Link to comment Share on other sites More sharing options...
0 lekpri 0 Odesláno: 5. Září, 2013 Author Share Odesláno: 5. Září, 2013 DooM Já nevím nenadávej , ja už jsem hotovej ze všeho jak jsem psal učím se to, znám nějaké věci znám to jo a plno lidí mě tady poradilo a naučilo, ale tohle nějak nechápu. Když třeba zčačnu a dám toto: #include "../include/gl_common.inc" tak mě to hodí ../include/gl_common.inc(134) : error 021: symbol already defined: "isNumeric" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. A když tam přidám tohle: #include "../include/gl_spawns.inc" ../include/gl_common.inc(134) : error 021: symbol already defined: "isNumeric" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1470) : warning 203: symbol is never used: "gArmySpawns" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1470) : warning 203: symbol is never used: "gMedicalSpawns" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1470) : warning 203: symbol is never used: "gPoliceSpawns" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1470) : warning 203: symbol is never used: "gRandomSpawns_LasVenturas" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1470) : warning 203: symbol is never used: "gRandomSpawns_LosSantos" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1470) : warning 203: symbol is never used: "gRandomSpawns_SanFierro" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. Link to comment Share on other sites More sharing options...
0 DooM 93 Odesláno: 5. Září, 2013 Share Odesláno: 5. Září, 2013 Ten první error je, že už někde v tom kódu je definována funkce isNumeric, takže je blbost abys jí znovu definoval. A ty další errory jsou, protože jsi naincludoval definice funkcí ale nevyužil je v kódu. Prostě aby ti ta auta šla tak celý kód bude vypadat takhle: #include<a_samp> public OnFilterScriptInit() { AddStaticVehicle(...); AddStaticVehicle(...); AddStaticVehicle(...); return true; } Link to comment Share on other sites More sharing options...
0 lekpri 0 Odesláno: 6. Září, 2013 Author Share Odesláno: 6. Září, 2013 DooM Ani tak to nejde Dam jsem čast GM tak jestli na to někdo přijde :: #pragma tabsize 0 // ******************************************************************************************************************** // Set default gamemode name // ******************************************************************************************************************** #define GameModeName "Nekonecna Parba - Trucking Server" // ******************************************************************************************************************** // Limit the amount of cops with a value greater than 0 // Setting this to "3" would mean: // - having 3 normal players (non-cop players) before the first cop can join the server // - having 6 normal players before 2 cops can be active // - having 9 normal players before the third cop can join and so on // Leaving this at 0 disables the police-limitation, so anyone can choose the police class anytime // ******************************************************************************************************************** new PlayersBeforePolice = 0; // ******************************************************************************************************************** // ******************************************************************************************************************** // Include default files #include <a_samp> #include <zcmd> #include <dutils> #include <sscanf2> #include <streamer> // Include all define-statements and custom-type declarations and the arrays which use them // These files need to be included before the functions get included, because the functions use the defines, custom types and the arrays // Also include the defined loads (for truckers, military, mafia, ...) and locations arrays #include <PPC_DefTexts> #include <PPC_ServerSettings> #include <PPC_Defines> #include <PPC_DefLocations> #include <PPC_DefLoads> #include <PPC_DefCars> #include <PPC_DefPlanes> #include <PPC_DefTrailers> #include <PPC_DefBuyableVehicles> // Include functions for this gamemode #include <PPC_GlobalTimer> #include <PPC_Common> #include <PPC_Housing> #include <PPC_Business> #include <PPC_GameModeInit> #include <PPC_FileOperations> #include <PPC_Speedometer> #include <PPC_MissionsTrucking> #include <PPC_MissionsBus> #include <PPC_MissionsPilot> #include <PPC_MissionsPolice> #include <PPC_MissionsMafia> #include <PPC_MissionsAssistance> #include <PPC_MissionsCourier> #include <PPC_MissionsRoadworker> #include <PPC_Convoys> #include <PPC_Dialogs> #include <PPC_PlayerCommands> #include <PPC_Toll> // The main function (used only once when the server loads) main() { // Print some standard lines to the server's console print("\n----------------------------------"); print(GameModeName); print("----------------------------------\n"); } // This callback gets called when the server initializes thettrr gamemode public OnGameModeInit() { new HostCommand[128]; // Change the hostname format(HostCommand, 128, "hostname %s", GameModeName); SendRconCommand(HostCommand); SetGameModeText(GameModeName); // Set the Mode of the gamemode, which appears in the list of servers GameModeInit_VehiclesPickups(); // Add all static vehicles and pickups when the server starts that are required (also load the houses) GameModeInit_Classes(); // Add character models to the class-selection (without weapons) Convoys_Init(); // Setup textdraws and default data for convoys ShowPlayerMarkers(1); // Show players on the entire map (and on the radar) ShowNameTags(1); // Show player names (and health) above their head ManualVehicleEngineAndLights(); // Let the server control the vehicle's engine and lights EnableStuntBonusForAll(0); // Disable stunt bonus for all players DisableInteriorEnterExits(); // Removes all building-entrances in the game UsePlayerPedAnims(); // Use CJ's walking animation // Start the timer that will show timed messages every 2 minutes SetTimer("Timer_TimedMessages", 1000 * 60 * 2, true); // Start the timer that will show a random bonus mission for truckers every 5 minutes SetTimer("ShowRandomBonusMission", 1000 * 60 * 5, true); // Start the timer that checks the toll-gates SetTimer("Toll", 1000, true); // Fix the bugged houses (after fixing the houses, you can remove this line, as it's not needed anymore) FixHouses(); // While the gamemode starts, start the global timer, and run it every second SetTimer("GlobalTimer", 1000, true); 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 if (IsPlayerNPC(playerid)) return 1; // Setup local variables new Name[MAX_PLAYER_NAME], NewPlayerMsg[128], HouseID; // 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_INPUT, 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 ShowPlayerDialog(playerid, DialogRegister, DIALOG_STYLE_INPUT, TXT_DialogRegisterTitle, TXT_DialogRegisterMsg, TXT_DialogRegisterButton1, TXT_DialogButtonCancel); // 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); // 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}Nepřijali jste ti {FFFF00}/rules{FF0000} jeste"); 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); } // This callback gets called when a player disconnects from the server public OnPlayerDisconnect(playerid, reason) { // 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[spectateID] == playerid) // Check if this player is spectating me { TogglePlayerSpectating(i, 0); // Turn off spectate-mode APlayerData[spectateID] = INVALID_PLAYER_ID; APlayerData[spectateType] = ADMIN_SPEC_TYPE_NONE; SendClientMessage(i, 0xFFFFFFFF, "{FF0000}Target player has logged off, ending spectate mode"); } // Send a message to all players to let them know somebody left the server format(Msg, 128, TXT_PlayerLeftServer, 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 ClassAssistance: Assistance_EndJob(playerid); 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][AssistanceNeeded] = false; APlayerData[playerid][PlayerPassword] = 0; APlayerData[playerid][PlayerLevel] = 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][statsAssistance] = 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}Jste stale umlcen"); // Don't allow his text to be sent to the chatbox return 0; } return 1; } // This callback gets called when a player interacts with a dialog public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { // Select the proper dialog to process switch (dialogid) { case DialogRegister: Dialog_Register(playerid, response, inputtext); // The "Register"-dialog case DialogLogin: Dialog_Login(playerid, response, inputtext); // The "Login"-dialog case DialogStatsOtherPlayer: Dialog_StatsOtherPlayer(playerid, response, listitem); case DialogStatsHouse: Dialog_StatsHouse(playerid, response, listitem); case DialogStatsGoHouse: Dialog_StatsGoHouse(playerid, response, listitem); case DialogStatsGoBusiness: Dialog_StatsGoBusiness(playerid, response, listitem); case DialogRescue: Dialog_Rescue(playerid, response, listitem); // The rescue-dialog case DialogBuyLicenses: Dialog_BuyLicenses(playerid, response, listitem); // The license-dialog (allows the player to buy trucker/busdriver licenses) case DialogRules: Dialog_Rules(playerid, response); case DialogTruckerJobMethod: Dialog_TruckerSelectJobMethod(playerid, response, listitem); // The work-dialog for truckers (shows the loads he can carry and lets the player choose the load) case DialogTruckerSelectLoad: Dialog_TruckerSelectLoad(playerid, response, listitem); // The load-selection dialog for truckers (shows the startlocations for the selected load and let the player choose his startlocation) case DialogTruckerStartLoc: Dialog_TruckerSelectStartLoc(playerid, response, listitem); // The start-location dialog for truckers (shows the endlocations for the selected load and let the player choose his endlocation) case DialogTruckerEndLoc: Dialog_TruckerSelectEndLoc(playerid, response, listitem); // The end-location dialog for truckers (processes the selected endlocation and starts the job) case DialogBusJobMethod: Dialog_BusSelectJobMethod(playerid, response, listitem); // The work-dialog for busdrivers (process the options to choose own busroute or auto-assigned busroute) case DialogBusSelectRoute: Dialog_BusSelectRoute(playerid, response, listitem); // Choose the busroute and start the job case DialogCourierSelectQuant: Dialog_CourierSelectQuant(playerid, response, listitem); case DialogBike: Dialog_Bike(playerid, response, listitem); // The bike-dialog case DialogCar: Dialog_Car(playerid, response, listitem); // The car-dialog (which uses a split dialog structure) case DialogPlane: Dialog_Plane(playerid, response, listitem); // The plane-dialog (which uses a split dialog structure) case DialogTrailer: Dialog_Trailer(playerid, response, listitem); // The trailer-dialog (which uses a split dialog structure) case DialogBoat: Dialog_Boat(playerid, response, listitem); // The boat-dialog case DialogNeon: Dialog_Neon(playerid, response, listitem); // The neon-dialog case DialogRentCarClass: Dialog_RentProcessClass(playerid, response, listitem); // The player chose a vehicleclass from where he can rent a vehicle case DialogRentCar: Dialog_RentCar(playerid, response, listitem); // The player chose a vehicle from the list of vehicles from the vehicleclass he chose before case DialogPlayerCommands: Dialog_PlayerCommands(playerid, response, listitem); // Displays all commands in a split-dialog structure case DialogPrimaryCarColor: Dialog_PrimaryCarColor(playerid, response, listitem); case DialogSedundaryCarColor: Dialog_SedundaryCarColor(playerid, response, listitem); case DialogWeather: Dialog_Weather(playerid, response, listitem); // The weather dialog case DialogCarOption: Dialog_CarOption(playerid, response, listitem); // The caroption dialog case DialogSelectConvoy: Dialog_SelectConvoy(playerid, response, listitem); case DialogHouseMenu: Dialog_HouseMenu(playerid, response, listitem); // Process the main housemenu case DialogUpgradeHouse: Dialog_UpgradeHouse(playerid, response, listitem); // Process the house-upgrade menu case DialogGoHome: Dialog_GoHome(playerid, response, listitem); // Port to one of your houses case DialogHouseNameChange: Dialog_ChangeHouseName(playerid, response, inputtext); // Change the name of your house case DialogSellHouse: Dialog_SellHouse(playerid, response); // Sell the house case DialogBuyCarClass: Dialog_BuyCarClass(playerid, response, listitem); // The player chose a vehicleclass from where he can buy a vehicle case DialogBuyCar: Dialog_BuyCar(playerid, response, listitem); // The player chose a vehicle from the list of vehicles from the vehicleclass he chose before case DialogSellCar: Dialog_SellCar(playerid, response, listitem); case DialogBuyInsurance: Dialog_BuyInsurance(playerid, response); case DialogGetCarSelectHouse: Dialog_GetCarSelectHouse(playerid, response, listitem); case DialogGetCarSelectCar: Dialog_GetCarSelectCar(playerid, response, listitem); case DialogUnclampVehicles: Dialog_UnclampVehicles(playerid, response); case DialogCreateBusSelType: Dialog_CreateBusSelType(playerid, response, listitem); case DialogBusinessMenu: Dialog_BusinessMenu(playerid, response, listitem); case DialogGoBusiness: Dialog_GoBusiness(playerid, response, listitem); case DialogBusinessNameChange: Dialog_ChangeBusinessName(playerid, response, inputtext); // Change the name of your business case DialogSellBusiness: Dialog_SellBusiness(playerid, response); // Sell the business case DialogBankPasswordRegister: Dialog_BankPasswordRegister(playerid, response, inputtext); case DialogBankPasswordLogin: Dialog_BankPasswordLogin(playerid, response, inputtext); case DialogBankOptions: Dialog_BankOptions(playerid, response, listitem); case DialogBankDeposit: Dialog_BankDeposit(playerid, response, inputtext); case DialogBankWithdraw: Dialog_BankWithdraw(playerid, response, inputtext); case DialogBankTransferMoney: Dialog_BankTransferMoney(playerid, response, inputtext); case DialogBankTransferName: Dialog_BankTransferName(playerid, response, inputtext); case DialogBankCancel: Dialog_BankCancel(playerid, response); case DialogHelpItemChosen: Dialog_HelpItemChosen(playerid, response, listitem); case DialogHelpItem: Dialog_HelpItem(playerid, response); case DialogOldPassword: Dialog_OldPassword(playerid, response, inputtext); case DialogNewPassword: Dialog_NewPassword(playerid, response, inputtext); case DialogConfirmPassword: Dialog_ConfirmPassword(playerid, response); } return 1; } // this callback gets called when a player clicks on another player on the scoreboard public OnPlayerClickPlayer(playerid, clickedplayerid, source) { // Check if the player is an admin of at least level 1 if (APlayerData[playerid][PlayerLevel] >= 1) { // Setup local variables new Name[24], DialogTitle[128], PlayerStatList[3000], PlayerIP[16], NumHouses, NumBusinesses; // Construct the dialog-title GetPlayerName(clickedplayerid, Name, sizeof(Name)); format(DialogTitle, 128, "Statistika hrace: %s", Name); // Add the IP of the player to the list GetPlayerIp(clickedplayerid, PlayerIP, sizeof(PlayerIP)); format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Hrac-IP: {00FF00}%s\n", PlayerStatList, PlayerIP); // Add the level of the player to the list format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Admin-level: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][PlayerLevel]); // Add the class of the player to the list switch(APlayerData[clickedplayerid][PlayerClass]) { case ClassTruckDriver: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Trucker\n", PlayerStatList); case ClassBusDriver: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Bus driver\n", PlayerStatList); case ClassPilot: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Pilot\n", PlayerStatList); case ClassPolice: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Police\n", PlayerStatList); case ClassMafia: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Mafia\n", PlayerStatList); case ClassCourier: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Courier\n", PlayerStatList); case ClassAssistance: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Assistance\n", PlayerStatList); } // Add money and score of the player to the list format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Penize: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][PlayerMoney]); format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Skore: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][PlayerScore]); // Add wanted-level of the player to the list format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Wanted-level: {00FF00}%i\n", PlayerStatList, GetPlayerWantedLevel(clickedplayerid)); // Add truckerlicense and busdriver license of the player to the list if (APlayerData[clickedplayerid][TruckerLicense] == 1) format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Trucker License: {00FF00}Yes\n", PlayerStatList); else format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Trucker License: {00FF00}No\n", PlayerStatList); if (APlayerData[clickedplayerid][busLicense] == 1) format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Bus License: {00FF00}Yes\n", PlayerStatList); else format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Bus License: {00FF00}No\n", PlayerStatList); format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Dokoncene trucker prace: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][statsTruckerJobs]); format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Dokoncene konvoj prace: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][statsConvoyJobs]); format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Dokoncene prace ridic autobusu: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][statsBusDriverJobs]); format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Dokoncene pilotni prace: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][statsPilotJobs]); format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Dokoncene mafie prace: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][statsMafiaJobs]); format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Stolen mafia-loads: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][statsMafiaStolen]); format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Pokutovanych hracu: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][statsPoliceFined]); format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Uvezneny hraci: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][statsPoliceJailed]); format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Dokoncene kuryrni prace : {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][statsCourierJobs]); format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Completed roadworker jobs: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][statsRoadworkerJobs]); format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Assisted players: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][statsAssistance]); format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Ujeli metru: {00FF00}%f\n", PlayerStatList, APlayerData[clickedplayerid][statsMetersDriven]); // Count the number of houses/businesses that the player has and add them to the list for (new i; i < MAX_HOUSESPERPLAYER; i++) if (APlayerData[clickedplayerid][Houses] != 0) NumHouses++; for (new i; i < MAX_BUSINESSPERPLAYER; i++) if (APlayerData[clickedplayerid][business] != 0) NumBusinesses++; format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Domy: {00FF00}%i (poklepejte na seznam)\n", PlayerStatList, NumHouses); format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Businesses: {00FF00}%i (poklepejte na seznam)\n", PlayerStatList, NumBusinesses); // Store the player-id of the other player so the other dialogs can display his statistics further (houses, businesses, cars) APlayerData[playerid][DialogOtherPlayer] = clickedplayerid; // Show the statistics of the other player ShowPlayerDialog(playerid, DialogStatsOtherPlayer, DIALOG_STYLE_LIST, DialogTitle, PlayerStatList, TXT_DialogButtonselect, TXT_DialogButtonCancel); // Let the player buy a license } return 1; } // This callback gets called when a player picks up any pickup public OnPlayerPickUpPickup(playerid, pickupid) { // If the player picks up the Buy_License pickup at the driving school in Doherty if (pickupid == Pickup_License) // Ask the player which license he wants to buy ShowPlayerDialog(playerid, DialogBuyLicenses, DIALOG_STYLE_LIST, TXT_DialogLicenseTitle, TXT_DialogLicenseList, TXT_DialogButtonBuy, TXT_DialogButtonCancel); // Let the player buy a license return 1; } // This callback gets called when a player spawns somewhere public OnPlayerSpawn(playerid) { // Always allow NPC's to spawn without logging in if (IsPlayerNPC(playerid)) return 1; // Check if the player properly logged in by typing his password if (APlayerData[playerid][LoggedIn] == false) { SendClientMessage(playerid, 0xFFFFFFFF, TXT_FailedLoginProperly); Kick(playerid); // Kick the player if he didn't log in properly } // Setup local variables new missiontext[200]; // Spawn the player in the global world (where everybody plays the game) SetPlayerVirtualWorld(playerid, 0); SetPlayerInterior(playerid, 0); // Also set a variable that tracks in which house the player currently is APlayerData[playerid][CurrentHouse] = 0; // Disable the clock TogglePlayerClock(playerid, 0); // Delete all weapons from the player ResetPlayerWeapons(playerid); // Set the missiontext based on the chosen class switch (APlayerData[playerid][PlayerClass]) { case ClassTruckDriver: // Truck-driver class { 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 { 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 { 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 { 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, PoliceWeaponsAmmo); } } case ClassMafia: // Mafia class { 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 { 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 { 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 { 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; } // This callback gets called whenever a player enters a checkpoint public OnPlayerEnterCheckpoint(playerid) { // Check the player's class switch (APlayerData[playerid][PlayerClass]) { case ClassTruckDriver: // Truckdriver class Trucker_OnPlayerEnterCheckpoint(playerid); // Process the checkpoint (load or unload goods) case ClassBusDriver: // BusDriver class { GameTextForPlayer(playerid, TXT_BusDriverMissionPassed, 3000, 4); // Show a message to let the player know he finished his job BusDriver_EndJob(playerid); // End the current mission } case ClassPilot: // Pilot class Pilot_OnPlayerEnterCheckpoint(playerid); // Process the checkpoint (load or unload) case ClassMafia: // Mafia class Mafia_OnPlayerEnterCheckpoint(playerid); case ClassCourier: // Courier class Courier_OnPlayerEnterCheckpoint(playerid); case ClassRoadWorker: // Roadworker class { // Only end the mission when doing "repair-speedcamera" jobtype (checkpoint is the base of the roadworker) if (APlayerData[playerid][JobID] == 1) // Repairing speedcamera's { GameTextForPlayer(playerid, TXT_RoadworkerMissionPassed, 3000, 4); // Show a message to let the player know he finished his job Roadworker_EndJob(playerid); // End the current mission } if (APlayerData[playerid][JobID] == 2) // Towing broken vehicle to shredder Roadworker_EnterCheckpoint(playerid); } } return 1; } // This callback gets called when a player enters a race-checkpoint public OnPlayerEnterRaceCheckpoint(playerid) { // Check the player's class switch (APlayerData[playerid][PlayerClass]) { case ClassBusDriver: // BusDriver class Bus_EnterRaceCheckpoint(playerid); // Process the checkpoint case ClassRoadWorker: // Roadworker class Roadworker_EnterRaceCheckpoint(playerid); } return 1; } // This callback gets called whenever a player dies public OnPlayerDeath(playerid, killerid, reason) { // Setup local variables new VictimName[24], KillerName[24], Msg[128]; // Clear the missiontext TextDrawSetString(APlayerData[playerid][MissionText], " "); // Hide the missiontext for this player (when the player is choosing a class, it's not required to show any mission-text) TextDrawHideForPlayer(playerid, APlayerData[playerid][MissionText]); // Stop any job that may have started switch (APlayerData[playerid][PlayerClass]) { case ClassTruckDriver: Trucker_EndJob(playerid); case ClassBusDriver: BusDriver_EndJob(playerid); case ClassPilot: Pilot_EndJob(playerid); case ClassPolice: Police_EndJob(playerid); case ClassMafia: Mafia_EndJob(playerid); case ClassCourier: Courier_EndJob(playerid); case ClassAssistance: Assistance_EndJob(playerid); case ClassRoadWorker: Roadworker_EndJob(playerid); } // If the player is part of a convoy, kick him from it Convoy_Leave(playerid); // If another player kills you, he'll get an extra star of his wanted level if (killerid != INVALID_PLAYER_ID) { // Increase the wanted level of the killer by one star SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1); // Get the name of the killed player and the killer GetPlayerName(playerid, VictimName, sizeof(VictimName)); GetPlayerName(killerid, KillerName, sizeof(KillerName)); // Let the killed know the police are informed about the kill format(Msg, 128, "{FF0000}You've killed {FFFF00}%s{FF0000}, you're wanted by the police now", VictimName); SendClientMessage(killerid, 0xFFFFFFFF, Msg); // Inform all police players about the kill format(Msg, 128, "{00FF00}Hrac {FFFF00}%s{00FF00} killed {FFFF00}%s{00FF00}, sledovat a najit ho", KillerName, VictimName); Police_SendMessage(Msg); } return 1; } // This callback gets called when the player is selecting a class (but hasn't clicked "Spawn" yet) public OnPlayerRequestClass(playerid, classid) { SetPlayerInterior(playerid,14); SetPlayerPos(playerid,258.4893,-41.4008,1002.0234); SetPlayerFacingAngle(playerid, 270.0); SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234); SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234); // 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: // 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 8, 9: // 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 10: // 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 11, 12, 13: // 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 14, 15, 16: // 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 17, 18: // 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 19: // Classes that will be assistance { // Display the name of the class GameTextForPlayer(playerid, TXT_ClassAssistance, 3000, 4); // Store the class for the player (assistance) APlayerData[playerid][PlayerClass] = ClassAssistance; } case 20, 21, 22: // 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 is called when the player attempts to spawn via class-selection public OnPlayerRequestSpawn(playerid) { new Index, Float:x, Float:y, Float:z, Float:Angle, Name[24], Msg[128]; // Get the player's name GetPlayerName(playerid, Name, sizeof(Name)); // Choose a random spawnlocation based on the player's class switch (APlayerData[playerid][PlayerClass]) { case ClassTruckDriver: { Index = random(sizeof(ASpawnLocationsTrucker)); // Get a random array-index to chose a random spawnlocation x = ASpawnLocationsTrucker[index][spawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsTrucker[index][spawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsTrucker[index][spawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsTrucker[index][spawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{00FF00}Hrac {FFFF00}%s{00FF00} se pripojil {FFFF00}Trucker tride", Name); } case ClassBusDriver: { Index = random(sizeof(ASpawnLocationsBusDriver)); x = ASpawnLocationsBusDriver[index][spawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsBusDriver[index][spawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsBusDriver[index][spawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsBusDriver[index][spawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{00FF00}Hrac {FFFF00}%s{00FF00} se pripojil {FFFF00}Busdriver tride", Name); } case ClassPilot: { Index = random(sizeof(ASpawnLocationsPilot)); x = ASpawnLocationsPilot[index][spawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsPilot[index][spawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsPilot[index][spawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsPilot[index][spawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{00FF00}Hrac {FFFF00}%s{00FF00} se pripojil {FFFF00}Pilot tride", Name); } case ClassPolice: { // Count the number of normal players (all classes except police) and count the amount of police players new NormalPlayers, PolicePlayers, bool:CanSpawnAsCop = false; // Block this check if PlayersBeforePolice is set to 0 (this allows anyone to join as police) if (PlayersBeforePolice > 0) { // Loop through all players for (new pid; pid < MAX_PLAYERS; pid++) { // Exclude this player, as he doesn't have a class yet, he's still choosing here if (pid != playerid) { // Also exclude all players who are still in the class-selection screen, as they don't have a class selected yet if (GetPlayerInterior(pid) != 14) { // Check if this player is logged in if (APlayerData[pid][LoggedIn] == true) { // Count the amount of normal players and police players switch (APlayerData[pid][PlayerClass]) { case ClassPolice: PolicePlayers++; case ClassTruckDriver, ClassBusDriver, ClassPilot, ClassMafia, ClassCourier, ClassAssistance, ClassRoadWorker: NormalPlayers++; } } } } } // Check if there are less police players than allowed if (PolicePlayers < (NormalPlayers / PlayersBeforePolice)) CanSpawnAsCop = true; // There are less police players than allowed, so the player can choose this class else CanSpawnAsCop = false; // The maximum amount of police players has been reached, the player can't choose to be a cop // Check if the player isn't allowed to spawn as police if (CanSpawnAsCop == false) { // Let the player know the maximum amount of cops has been reached GameTextForPlayer(playerid, "Maximalni vyse policistu jiz dosahly", 5000, 4); SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Maximalni mnozstvi policistu bylo dosazeno jiz, prosim, vyberte jinou tridu"); return 0; // Don't allow the player to spawn as police player } } // If the player has less than 100 scorepoints if (APlayerData[playerid][PlayerScore] < 100) { // Let the player know he needs 100 scorepoints GameTextForPlayer(playerid, "Potrebujete 100 score pro policejni praci", 5000, 4); SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Potrebujete 100 score pro policejni praci"); return 0; // Don't allow the player to spawn as police player } // If the player has a wanted level if (GetPlayerWantedLevel(playerid) > 0) { // Let the player know he cannot have a wanted level to join police GameTextForPlayer(playerid, "Neni dovoleno vybrat si policie praci, kdyz si hledan", 5000, 4); SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Neni dovoleno vybrat si policie praci, kdyz si hledan"); return 0; // Don't allow the player to spawn as police player } Index = random(sizeof(ASpawnLocationsPolice)); x = ASpawnLocationsPolice[index][spawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsPolice[index][spawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsPolice[index][spawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsPolice[index][spawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{00FF00}Hrac {FFFF00}%s{00FF00} se pripojil k {FFFF00}Police prace", Name); } case ClassMafia: { Index = random(sizeof(ASpawnLocationsMafia)); x = ASpawnLocationsMafia[index][spawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsMafia[index][spawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsMafia[index][spawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsMafia[index][spawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{00FF00}Hrac {FFFF00}%s{00FF00} se pripojil k {FFFF00}Mafia prace", Name); } case ClassCourier: { Index = random(sizeof(ASpawnLocationsCourier)); x = ASpawnLocationsCourier[index][spawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsCourier[index][spawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsCourier[index][spawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsCourier[index][spawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{00FF00}Hrac {FFFF00}%s{00FF00} se pripojil {FFFF00}Kuryr prace", Name); } case ClassAssistance: { Index = random(sizeof(ASpawnLocationsAssistance)); x = ASpawnLocationsAssistance[index][spawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsAssistance[index][spawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsAssistance[index][spawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsAssistance[index][spawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{00FF00}Hrac {FFFF00}%s{00FF00} se pripojil {FFFF00}Assistance prace", Name); } case ClassRoadWorker: { Index = random(sizeof(ASpawnLocationsRoadWorker)); x = ASpawnLocationsRoadWorker[index][spawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsRoadWorker[index][spawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsRoadWorker[index][spawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsRoadWorker[index][spawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{00FF00}Hrac {FFFF00}%s{00FF00} se pripojil {FFFF00}Roadworker prace", Name); } } // Spawn the player with his chosen skin at a random location based on his class SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), x, y, z, Angle, 0, 0, 0, 0, 0, 0); // Send the message to all players (who joined which class) SendClientMessageToAll(0xFFFFFFFF, Msg); return 1; } // This callback gets called when a vehicle respawns at it's spawn-location (where it was created) public OnVehicleSpawn(vehicleid) { // Set the vehicle as not-wanted by the mafia AVehicleData[vehicleid][MafiaLoad] = false; // Also reset the fuel to maximum (only for non-owned vehicles) if (AVehicleData[vehicleid][Owned] == false) AVehicleData[vehicleid][Fuel] = MaxFuel; // Re-apply the paintjob (if any was applied) if (AVehicleData[vehicleid][PaintJob] != 0) { // Re-apply the paintjob ChangeVehiclePaintjob(vehicleid, AVehicleData[vehicleid][PaintJob] - 1); } // Also update the car-color ChangeVehicleColor(vehicleid, AVehicleData[vehicleid][Color1], AVehicleData[vehicleid][Color2]); // Re-add all components that were installed (if they were there) for (new i; i < 14; i++) { // Remove all mods from the vehicle (all added mods applied by hackers will hopefully be removed this way when the vehicle respawns) RemoveVehicleComponent(vehicleid, GetVehicleComponentInSlot(vehicleid, i)); // Check if the componentslot has a valid component-id if (AVehicleData[vehicleid][Components] != 0) AddVehicleComponent(vehicleid, AVehicleData[vehicleid][Components]); // Add the component to the vehicle } return 1; } // This callback is called when the vehicle leaves a mod shop public OnVehicleRespray(playerid, vehicleid, color1, color2) { // Let the player pay $150 for changing the color (if they have been changed) if ((AVehicleData[vehicleid][Color1] != color1) || (AVehicleData[vehicleid][Color2] != color2)) { RewardPlayer(playerid, -150, 0); SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Zmenili jste barvu Vaseho vozidla $150"); } // Save the colors AVehicleData[vehicleid][Color1] = color1; AVehicleData[vehicleid][Color2] = color2; // If the primary color is black, remove the paintjob if (color1 == 0) AVehicleData[vehicleid][PaintJob] = 0; return 1; } // This callback gets called when a player enters or exits a mod-shop public OnEnterExitModShop(playerid, enterexit, interiorid) { return 1; } // This callback gets called whenever a player mods his vehicle public OnVehicleMod(playerid, vehicleid, componentid) { // When the player changes a component of his vehicle, reduce the price of the component from the player's money APlayerData[playerid][PlayerMoney] = APlayerData[playerid][PlayerMoney] - AVehicleModPrices[componentid - 1000]; // Store the component in the AVehicleData array AVehicleData[vehicleid][Components][GetVehicleComponentType(componentid)] = componentid; return 1; } // This callback gets called whenever a player VIEWS at a paintjob in a mod garage (viewing automatically applies it) public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { // Store the paintjobid for the vehicle (add 1 to the value, otherwise checking for an applied paintjob is difficult) AVehicleData[vehicleid][PaintJob] = paintjobid + 1; return 1; } // This callback gets called whenever a player enters a vehicle public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { // Setup local variables new engine, lights, alarm, doors, bonnet, boot, objective; // Check if the vehicle has fuel if (AVehicleData[vehicleid][Fuel] > 0) { // Start the engine and turn on the lights GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, objective); } // Store the player's current location and interior-id, otherwise anti-airbreak hack code could kick you GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]); APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid); return 1; } Dal jsem tam ´toto: #include "../include/gl_spawns.inc" #pragma unused gArmySpawns, gMedicalSpawns, gPoliceSpawns, gRandomSpawns_LasVenturas, gRandomSpawns_LosSantos, gRandomSpawns_SanFierro Ale, auta tam nemam a když tam dam své tak nemá benzín Netuším jak jsem dával ty auta, když jsem žádné nenašel Link to comment Share on other sites More sharing options...
0 8eep 0 Odesláno: 7. Září, 2013 Share Odesláno: 7. Září, 2013 Skús ešte toto ale keď to nepôjde tak už nwm čo s tým máš: Include: #include <a_samp> #include <core> #include <float> #include "../include/gl_common.inc" #include "../include/gl_spawns.inc" New: new total_vehicles_from_files=0; Define,Pragma: #pragma tabsize 0 #define CITY_LOS_SANTOS 0 #define CITY_SAN_FIERRO 1 #define CITY_LAS_VENTURAS 2 OnGameModeInit: public OnGameModeInit() { // Special total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/trains.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/pilots.txt"); // Lv total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt"); // Sf total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_law.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_gen.txt"); // Ls total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt"); // Ostatní total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/whetstone.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/bone.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/flint.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/tierra.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/red_county.txt"); printf("Total vehicles from files: %d",total_vehicles_from_files); return 1; } A keď to tam dáš tak ti to buď vyhodí 6 warningov..alebo to budeš mať bez chyby.Warning bude symbol is never used:...... Takých by si tam mal mať 6 aspoň ja ich mám 6 v móde Link to comment Share on other sites More sharing options...
0 mxco 55 Odesláno: 7. Září, 2013 Share Odesláno: 7. Září, 2013 Ani ty auta, který tam dáš tím LoadStaticVehiclesFromFile, ti nepojedou. Takovou zkušenost jsem již měl. Chyba je v OnGameModeInit a konkretně u funkce ManualVehicleEngineAndLights(); http://wiki.sa-mp.com/wiki/ManualVehicleEngineAndLights Zabranuje automatickemu rožínání motoru nebo světel a naopak zhasínání. Ovšem, pokud budeš chtít k tomu přidat to startování motoru, tak to mužeš nechat, ale musíš k tomu přidat SetVehicleParamsEx http://wiki.sa-mp.com/wiki/SetVehicleParamsEx Link to comment Share on other sites More sharing options...
0 lekpri 0 Odesláno: 7. Září, 2013 Author Share Odesláno: 7. Září, 2013 C:\Users\Pavel\Desktop\PPC_Trucking6\pawno\include\dutils.inc(28) : error 021: symbol already defined: "isNumeric" C:\Users\Pavel\Desktop\PPC_Trucking6\pawno\include\dutils.inc(379) : error 025: function heading differs from prototype C:\Users\Pavel\Desktop\PPC_Trucking6\pawno\include\dutils.inc(380) : error 021: symbol already defined: "strtok" C:\Users\Pavel\Desktop\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(2904) : warning 219: local variable "HostCommand" shadows a variable at a preceding level C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(120) : warning 217: loose indentation C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(128) : error 021: symbol already defined: "format" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(132) : error 021: symbol already defined: "GameModeInit_VehiclesPickups" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(133) : error 021: symbol already defined: "GameModeInit_Classes" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(135) : error 021: symbol already defined: "Convoys_Init" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(137) : error 021: symbol already defined: "ShowPlayerMarkers" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(145) : error 021: symbol already defined: "SetTimer" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(147) : error 021: symbol already defined: "SetTimer" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(149) : error 021: symbol already defined: "SetTimer" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(152) : error 021: symbol already defined: "FixHouses" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(155) : error 021: symbol already defined: "SetTimer" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(157) : error 010: invalid function or declaration C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "AddCarDealerPickup" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "AddRefuelPickup" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "AddTollGate" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "BusinessFile_Load" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "BusinessTime_Load" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "Business_LoadAll" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "CameraFile_Load" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "Camera_LoadAll" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "Convoys_Init" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "GameModeInit_Airports" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "GameModeInit_Assistance" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "GameModeInit_Busses" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "GameModeInit_Busstops" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "GameModeInit_Classes" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "GameModeInit_Courier" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "GameModeInit_Mafia" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "GameModeInit_PickupsIcons" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "GameModeInit_Police" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "GameModeInit_RoadWorker" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "GameModeInit_Toll" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "GameModeInit_TruckDepots" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "GameModeInit_VehiclesPickups" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "HostCommand" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "Housing_LoadAll" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "IntrestTime_Load" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "Vehicle_AddStatic" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "gArmySpawns" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "gMedicalSpawns" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "gPoliceSpawns" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "gRandomSpawns_LasVenturas" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "gRandomSpawns_LosSantos" C:\Users\Pavel\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1509) : warning 203: symbol is never used: "gRandomSpawns_SanFierro" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 14 Errors. Link to comment Share on other sites More sharing options...
Dotaz
lekpri 0
Ahoj.
Mam problém v tom že auta ktere vložím do GM se nerozjedou. Jezdí auta pouze ty co jsou v GM ale ty co tam vložím já nejedou .
Zajímave je, že v GM není ani jedno auto. Poradí někdo?
Chtěl bych si do GM vložiz i svá auta. Děkuji za rady
Link to comment
Share on other sites
16 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now