[GameMode] PPC_Trucking V1

having problem to run the server.. When i run the ppc_trucking server than it says: "Script [gamemodes/PPC_Trucking.amx]: Run time error 19: "file or function in not found"
and when i run pawno and open PPC_Trucking.amx and than "compile" it says error: Unable to execute compiler...
What can be the problem and how can i solve it?
I put pic about problem
Reply

Quote:
Originally Posted by Nikk123
View Post
Where i can change the font of the textdraw :/ ?
Open the main gamemode file (PPC_Trucking.pwn) and search for this: "TextDrawCreate".
You'll get to line 172:
pawn Code:
// 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
Just add a line like this:
pawn Code:
TextDrawFont(APlayerData[playerid][MissionText], 2);
This will change the font of this textdraw to font 2.

Save and recompile the gamemode.





Quote:
Originally Posted by (ETR)Geto244
View Post
having problem to run the server.. When i run the ppc_trucking server than it says: "Script [gamemodes/PPC_Trucking.amx]: Run time error 19: "file or function in not found"
and when i run pawno and open PPC_Trucking.amx and than "compile" it says error: Unable to execute compiler...
What can be the problem and how can i solve it?
I put pic about problem
About error 19: this suggests it cannot find some plugin.
Check the server console or the "server_log.txt" file to check which plugin isn't loading.

About the compiler, you'll have to search the forums for this.
I never got that error so I can't help you solve it.




UPDATE on V2:
I've been reviewing some code and correcting comments (currently only the speedometer script has been reviewed).
Some comments didn't match the code that followed the comments.

I've also expanded the speedometer script to include vehicle-names being displayed on the bottom of the screen.
Also the housing script has been modified to include vehicle-names for your owned vehicles.
Now it's possible to rename your owned vehicles through the house-menu.

Also the /getcar command has been modified to display your vehicle-name, instead of getting it from the array "ABuyableVehicles".

The speedometer script also accesses the housing-script to find out if the vehicle is owned by the housing script.
If it is, then the vehicle-name stored in the housing script is sent to the speedometer script to be displayed.
If it isn't owned, the default vehicle-name (based on the model) is displayed.
Reply

how i change money of all things like :
-car/boats/planes
-the moeny you et whit job finis
-and more
Reply

Quote:
Originally Posted by warlordkil
View Post
how i change money of all things like :
-car/boats/planes
-the moeny you et whit job finis
-and more

Not to sure if you can change how much you get for a job as it is done by how far away the start point and end point are you will have to ask power about that one but for the car prices

got to pawno/include/PPC_DefBuyablevehicles


There should be a massive list of things looking like this


{"Admiral", VClassSaloons, 445, 50000},


So to change the buy price to 200000 you would just do

{"Admiral", VClassSaloons, 445, 200000},
Reply

PPC faq has been held down by me till he gets back... :\
Reply

/: So you can't tell me to how can i add spawn points? and more vehicles.
Reply

PREVIOUS POST IS SOLVED.

Now i created spawn points, everything its ok but when i compile (i also created vehicles) those warnings appears.


C:\Users\Prueba\Downloads\Gamemodes RP\Trucking - EDICIONES\pawno\include\PPC_GameModeInit.inc(302) : warning 217: loose indentation
C:\Users\Prueba\Downloads\Gamemodes RP\Trucking - EDICIONES\pawno\include\PPC_GameModeInit.inc(304) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Warnings.


Code:


// Add trailers and trucks to Shady Creek Depot (Class 7)
LastVehicleID = Vehicle_AddStatic(VehicleTrailerCargo, -1545.0, -2737.00, 49.0, 145.0, random(126), random(126), 600); // Cargo trailer
LastVehicleID = Vehicle_AddStatic(VehicleTrailerOre, -1540.9, -2739.87, 49.0, 145.0, random(126), random(126), 600); // Ore trailer
LastVehicleID = Vehicle_AddStatic(VehicleTrailerFluids, -1536.8, -2742.74, 49.0, 145.0, random(126), random(126), 600); // Liquids trailer
LastVehicleID = Vehicle_AddStatic(VehicleTrailerCargo, -1532.7, -2745.61, 49.0, 145.0, random(126), random(126), 600); // Cargo trailer
LastVehicleID = Vehicle_AddStatic(VehicleTrailerOre, -1528.6, -2748.48, 49.0, 145.0, random(126), random(126), 600); // Ore trailer
LastVehicleID = Vehicle_AddStatic(VehicleTrailerFluids, -1524.5, -2751.35, 49.0, 145.0, random(126), random(126), 600); // Liquids trailer
LastVehicleID = Vehicle_AddStatic(VehicleLineRunner, -1557.75, -2744.80, 49.0, 145.0, random(126), random(126), 600); // LineRunner
LastVehicleID = Vehicle_AddStatic(VehicleTanker, -1561.85, -2741.93, 49.0, 145.0, random(126), random(126), 600); // Tanker
LastVehicleID = Vehicle_AddStatic(VehicleRoadTrain, -1565.95, -2739.06, 49.0, 145.0, random(126), random(126), 600); // Roadtrain
LastVehicleID = Vehicle_AddStatic(VehicleLineRunner, -1570.05, -2736.19, 49.0, 145.0, random(126), random(126), 600); // LineRunner
LastVehicleID = Vehicle_AddStatic(VehicleTanker, -1574.15, -2733.32, 49.0, 145.0, random(126), random(126), 600); // Tanker
LastVehicleID = Vehicle_AddStatic(VehicleRoadTrain, -1578.25, -2730.45, 49.0, 145.0, random(126), random(126), 600); // Roadtrain

// Add roadtrains to LV deposito (Class
(302) LastVehicleID = Vehicle_AddStatic(VehicleRoadTrain, 2792.59, 2634.73, 11.84, 207.30, random(126), random(126), 600); // Roadtrain
LastVehicleID = Vehicle_AddStatic(VehicleRoadTrain, 2786.05, 2634.78, 11.83, 207.30, random(126), random(126), 600); // Roadtrain
(304) LastVehicleID = Vehicle_AddStatic(VehicleTrailerFluids, 2805.394, 2634.099, 11.915, 207.30, random(126), random(126), 600); // Liquids trailer
LastVehicleID = Vehicle_AddStatic(VehicleTrailerFluids, 2800.059, 2632.235, 11.922, 207.30, random(126), random(126), 600); // Liquids trailer


Bold letter means the created 'section' for these cars to spawn in that location
And the first part is the previous 'section' for other spawn point made by PPC.

I know that this is just a few of errors, but i want to keep it clean!
Reply

Sorry for double post, but now i got another thing.

I'm viewing that this post is inactive..

I defined Yankee's car, etc etc. It works perfectly when i select router, but when i click select random route, it doesn't work.

I need help
Reply

triple post^^^^

use pawn tags [ pawn ] [ /pawn ]
Reply

Ok, now i fixed all my problems.

Another thing, how can i add min scorepoints to be mafia?

SOLVED

PD: This post is dead.
Reply

Quote:
Originally Posted by KINGINA
View Post
PowerPC603 Can you come on my server, I have bug i can't see any house or busniess icon i've do everything what i need to do... Someone HELP!!! Please
Do you eaven have created houses or businesses? At the first you need to tp /createhouse <houselevel(1-10)> <houseprice> or /createbusiness and it makes house/business in your location. And than it must work fine.
Reply

Quote:
Originally Posted by jeremy8810
View Post
My server is now online but when i send a pm to id 3, id 0 receive it ?? how can this be?

Thanks

Jeremy
You need to download the latest sscanf and copy all things over in your sscanf file. And when you dont have microsoft net framework 2.0 than download it to. And everything must be ok.
Reply

Use 150 for the payment, not -150.
The code already inverts the money into a negative value.
Using a negative value means you'll get a positive value in the end and you get money instead of paying it.
Reply

donttouch made me laugh this time,really havent you studied maths ?
Reply

hehe i have never studied maths ;p sorry ..
PHP Code:
What does math with this code 
HTML Code:
i think you r the 1 who havent studied math ... dam kid
Reply

Epic gamemode
Reply

PowerPC Can you write an example? pls
Reply

Good One.
Reply

Quote:
Originally Posted by DDR3
View Post
PowerPC Can you write an example? pls
An example of my new class-selection?

You should be able to use the following code directly.
If you get it right, you should have no errors (AFAIK) and you'll have the same class-selection as my current V2.
NOTE that this works with the default V1 (without changes to the classes).
If you already made changes to it, you'll have to redo them of course.



Paste this at the top of the gamemode:
pawn Code:
// Create an array that holds the vehicleid's for vehicles and trailers at class-selection for all players
new AClassSelectionVehicles[MAX_PLAYERS][2];


Replace the callback OnPlayerRequestClass with this one:
pawn Code:
// This callback gets called when the player is selecting a class (but hasn't clicked "Spawn" yet)
public OnPlayerRequestClass(playerid, classid)
{
    // Setup local variables
    new LastClass, bool:VehicleSpawned = false;

    // Set the virtual world and interior for class-selection
    SetPlayerVirtualWorld(playerid, 15000 + playerid);
    SetPlayerInterior(playerid, 0);

    // Get the player's current class and set it as LastClass
    LastClass = APlayerData[playerid][PlayerClass];
    // Also check if there is currently a vehicle spawned
    if (AClassSelectionVehicles[playerid][0] == 0)
        VehicleSpawned = false;
    else
        VehicleSpawned = true;

    // 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;
        }
    }

    // If the LastClass isn't the same as the current class, delete the current class-selection vehicles
    if (APlayerData[playerid][PlayerClass] != LastClass)
    {
        // Delete both class-selection vehicles if they exist
        for (new i; i < 2; i++)
        {
            if (AClassSelectionVehicles[playerid][i] != 0)
            {
                DestroyVehicle(AClassSelectionVehicles[playerid][i]);
                AClassSelectionVehicles[playerid][i] = 0;
            }
        }
    }

    // Determine at which coordinates the player, his camera and a few vehicles should be placed, based on the chosen class
    switch (APlayerData[playerid][PlayerClass])
    {
        case ClassTruckDriver:
        {
            // Create a Roadtrain truck and a trailer for class-selection, and put the player inside to make them appear
            if ((APlayerData[playerid][PlayerClass] != LastClass) || (VehicleSpawned == false))
            {
                AClassSelectionVehicles[playerid][0] = Vehicle_CreateCS(playerid, 515, 1457.7, 1005.1, 11.8, 131.0, 1, 2);
                AClassSelectionVehicles[playerid][1] = Vehicle_CreateCS(playerid, 435, 1466.2, 1009.8, 11.4, 90.0, 1, 2);
            }
            SetPlayerPos(playerid, 1459.0, 999.0, 10.82);
            SetPlayerFacingAngle(playerid, 180.0);
            SetPlayerCameraPos(playerid, 1459.0, 992.0, 12.0);
            SetPlayerCameraLookAt(playerid, 1459.0, 1009.0, 10.82);
        }
        case ClassBusDriver:
        {
            // Create a bus for class-selection, and put the player inside to make it appear
            if ((APlayerData[playerid][PlayerClass] != LastClass) || (VehicleSpawned == false))
                AClassSelectionVehicles[playerid][0] = Vehicle_CreateCS(playerid, 437, 1792.6, -1904.7, 13.53, 203.8, 1, 2);
            SetPlayerPos(playerid, 1797.8, -1908.5, 13.4);
            SetPlayerFacingAngle(playerid, 250.0);
            SetPlayerCameraPos(playerid, 1803.2, -1911.6, 14.6);
            SetPlayerCameraLookAt(playerid, 1792.6, -1904.7, 13.53);
        }
        case ClassPilot:
        {
            // Create a shamal for class-selection, and put the player inside to make it appear
            if ((APlayerData[playerid][PlayerClass] != LastClass) || (VehicleSpawned == false))
                AClassSelectionVehicles[playerid][0] = Vehicle_CreateCS(playerid, 519, -1411.5, 81.0, 15.06, 133.5, 1, 2);
            SetPlayerPos(playerid, -1419.3, 79.5, 14.15);
            SetPlayerFacingAngle(playerid, 93.0);
            SetPlayerCameraPos(playerid, -1427.3, 79.4, 15.8);
            SetPlayerCameraLookAt(playerid, -1411.5, 81.0, 15.06);
        }
        case ClassPolice:
        {
            // Create a police car and ranger for class-selection, and put the player inside to make them appear
            if ((APlayerData[playerid][PlayerClass] != LastClass) || (VehicleSpawned == false))
            {
                AClassSelectionVehicles[playerid][0] = Vehicle_CreateCS(playerid, 598, 2284.8, 2422.3, 10.56, 133.4, 1, 0);
                AClassSelectionVehicles[playerid][1] = Vehicle_CreateCS(playerid, 599, 2292.7, 2422.4, 11.01, 229.0, 1, 0);
            }
            SetPlayerPos(playerid, 2288.5, 2420.9, 10.82);
            SetPlayerFacingAngle(playerid, 180.0);
            SetPlayerCameraPos(playerid, 2288.0, 2410.0, 10.88);
            SetPlayerCameraLookAt(playerid, 2288.0, 2422.3, 12.0);
        }
        case ClassMafia:
        {
            // Create a Sandking for class-selection, and put the player inside to make it appear
            if ((APlayerData[playerid][PlayerClass] != LastClass) || (VehicleSpawned == false))
                AClassSelectionVehicles[playerid][0] = Vehicle_CreateCS(playerid, 495, 2823.7, 921.7, 11.1, 228.0, 0, 0);
            SetPlayerPos(playerid, 2823.4, 918.0, 10.75);
            SetPlayerFacingAngle(playerid, 180.0);
            SetPlayerCameraPos(playerid, 2822.7, 911.5, 10.75);
            SetPlayerCameraLookAt(playerid, 2823.4, 918.0, 10.75);
        }
        case ClassCourier:
        {
            // Create a Faggio and Burrito for class-selection, and put the player inside to make them appear
            if ((APlayerData[playerid][PlayerClass] != LastClass) || (VehicleSpawned == false))
            {
                AClassSelectionVehicles[playerid][0] = Vehicle_CreateCS(playerid, 462, -1855.0, -139.0, 11.49, 51.5, 1, 2);
                AClassSelectionVehicles[playerid][1] = Vehicle_CreateCS(playerid, 482, -1850.6, -139.0, 12.01, 340.0, 1, 2);
            }
            SetPlayerPos(playerid, -1853.3, -138.0, 11.9);
            SetPlayerFacingAngle(playerid, 15.0);
            SetPlayerCameraPos(playerid, -1855.0, -130.7, 11.9);
            SetPlayerCameraLookAt(playerid, -1853.3, -138.0, 11.9);
        }
        case ClassAssistance:
        {
            // Create a Towtruck for class-selection, and put the player inside to make it appear
            if ((APlayerData[playerid][PlayerClass] != LastClass) || (VehicleSpawned == false))
                AClassSelectionVehicles[playerid][0] = Vehicle_CreateCS(playerid, 525, -1903.9, 271.8, 40.91, 126.0, 1, 2);
            SetPlayerPos(playerid, -1903.8, 267.4, 41.0);
            SetPlayerFacingAngle(playerid, 162.0);
            SetPlayerCameraPos(playerid, -1906.3, 259.8, 40.3);
            SetPlayerCameraLookAt(playerid, -1903.8, 267.4, 41.0);
        }
        case ClassRoadWorker:
        {
            // Create a xxx for class-selection, and put the player inside to make them appear
            if ((APlayerData[playerid][PlayerClass] != LastClass) || (VehicleSpawned == false))
            {
                AClassSelectionVehicles[playerid][0] = Vehicle_CreateCS(playerid, 552, -1877.4, -1719.4, 21.43, 59.95, 1, 2);
                AClassSelectionVehicles[playerid][1] = Vehicle_CreateCS(playerid, 611, -1872.8, -1722.1, 21.4, 59.95, 1, 2);
            }
            SetPlayerPos(playerid, -1879.5, -1723.7, 21.75);
            SetPlayerFacingAngle(playerid, 133.0);
            SetPlayerCameraPos(playerid, -1886.1, -1729.5, 21.75);
            SetPlayerCameraLookAt(playerid, -1879.5, -1723.7, 23.0);
        }
    }

    return 1;
}


Add this function below OnPlayerRequestClass:
pawn Code:
// This function is only used during class-selection
Vehicle_CreateCS(playerid, vModel, Float:x, Float:y, Float:z, Float:rot, Col1, Col2)
{
    // Create the given vehicle at the given coordinates
    new vid = CreateVehicle(vModel, x, y, z, rot, Col1, Col2, 60);
    // Set the vehicle in the player's virtual world for class-selection
    SetVehicleVirtualWorld(vid, 15000 + playerid);
    // Put the player inside the vehicle to make it appear
    PutPlayerInVehicle(playerid, vid, 0);
    // Return the vehicle-id
    return vid;
}

Finally, Inside the callback OnPlayerRequestSpawn, you'll find this:
pawn Code:
// 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;
}
Add this code just above it:
pawn Code:
// Delete both class-selection vehicles if they exist
    for (new i; i < 2; i++)
    {
        if (AClassSelectionVehicles[playerid][i] != 0)
        {
            DestroyVehicle(AClassSelectionVehicles[playerid][i]);
            AClassSelectionVehicles[playerid][i] = 0;
        }
    }


Then compile the gamemode.
It should work without errors.
If you get errors, please let me know.
Reply

Quote:
Originally Posted by PowerPC603
View Post
An example of my new class-selection?

You should be able to use the following code directly.
If you get it right, you should have no errors (AFAIK) and you'll have the same class-selection as my current V2.
NOTE that this works with the default V1 (without changes to the classes).
If you already made changes to it, you'll have to redo them of course.



Paste this at the top of the gamemode:
pawn Code:
// Create an array that holds the vehicleid's for vehicles and trailers at class-selection for all players
new AClassSelectionVehicles[MAX_PLAYERS][2];


Replace the callback OnPlayerRequestClass with this one:
pawn Code:
// This callback gets called when the player is selecting a class (but hasn't clicked "Spawn" yet)
public OnPlayerRequestClass(playerid, classid)
{
    // Setup local variables
    new LastClass, bool:VehicleSpawned = false;

    // Set the virtual world and interior for class-selection
    SetPlayerVirtualWorld(playerid, 15000 + playerid);
    SetPlayerInterior(playerid, 0);

    // Get the player's current class and set it as LastClass
    LastClass = APlayerData[playerid][PlayerClass];
    // Also check if there is currently a vehicle spawned
    if (AClassSelectionVehicles[playerid][0] == 0)
        VehicleSpawned = false;
    else
        VehicleSpawned = true;

    // 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;
        }
    }

    // If the LastClass isn't the same as the current class, delete the current class-selection vehicles
    if (APlayerData[playerid][PlayerClass] != LastClass)
    {
        // Delete both class-selection vehicles if they exist
        for (new i; i < 2; i++)
        {
            if (AClassSelectionVehicles[playerid][i] != 0)
            {
                DestroyVehicle(AClassSelectionVehicles[playerid][i]);
                AClassSelectionVehicles[playerid][i] = 0;
            }
        }
    }

    // Determine at which coordinates the player, his camera and a few vehicles should be placed, based on the chosen class
    switch (APlayerData[playerid][PlayerClass])
    {
        case ClassTrucker:
        {
            // Create a Roadtrain truck and a trailer for class-selection, and put the player inside to make them appear
            if ((APlayerData[playerid][PlayerClass] != LastClass) || (VehicleSpawned == false))
            {
                AClassSelectionVehicles[playerid][0] = Vehicle_CreateCS(playerid, 515, 1457.7, 1005.1, 11.8, 131.0, 1, 2);
                AClassSelectionVehicles[playerid][1] = Vehicle_CreateCS(playerid, 435, 1466.2, 1009.8, 11.4, 90.0, 1, 2);
            }
            SetPlayerPos(playerid, 1459.0, 999.0, 10.82);
            SetPlayerFacingAngle(playerid, 180.0);
            SetPlayerCameraPos(playerid, 1459.0, 992.0, 12.0);
            SetPlayerCameraLookAt(playerid, 1459.0, 1009.0, 10.82);
        }
        case ClassBusdriver:
        {
            // Create a bus for class-selection, and put the player inside to make it appear
            if ((APlayerData[playerid][PlayerClass] != LastClass) || (VehicleSpawned == false))
                AClassSelectionVehicles[playerid][0] = Vehicle_CreateCS(playerid, 437, 1792.6, -1904.7, 13.53, 203.8, 1, 2);
            SetPlayerPos(playerid, 1797.8, -1908.5, 13.4);
            SetPlayerFacingAngle(playerid, 250.0);
            SetPlayerCameraPos(playerid, 1803.2, -1911.6, 14.6);
            SetPlayerCameraLookAt(playerid, 1792.6, -1904.7, 13.53);
        }
        case ClassPilot:
        {
            // Create a shamal for class-selection, and put the player inside to make it appear
            if ((APlayerData[playerid][PlayerClass] != LastClass) || (VehicleSpawned == false))
                AClassSelectionVehicles[playerid][0] = Vehicle_CreateCS(playerid, 519, -1411.5, 81.0, 15.06, 133.5, 1, 2);
            SetPlayerPos(playerid, -1419.3, 79.5, 14.15);
            SetPlayerFacingAngle(playerid, 93.0);
            SetPlayerCameraPos(playerid, -1427.3, 79.4, 15.8);
            SetPlayerCameraLookAt(playerid, -1411.5, 81.0, 15.06);
        }
        case ClassPolice:
        {
            // Create a police car and ranger for class-selection, and put the player inside to make them appear
            if ((APlayerData[playerid][PlayerClass] != LastClass) || (VehicleSpawned == false))
            {
                AClassSelectionVehicles[playerid][0] = Vehicle_CreateCS(playerid, 598, 2284.8, 2422.3, 10.56, 133.4, 1, 0);
                AClassSelectionVehicles[playerid][1] = Vehicle_CreateCS(playerid, 599, 2292.7, 2422.4, 11.01, 229.0, 1, 0);
            }
            SetPlayerPos(playerid, 2288.5, 2420.9, 10.82);
            SetPlayerFacingAngle(playerid, 180.0);
            SetPlayerCameraPos(playerid, 2288.0, 2410.0, 10.88);
            SetPlayerCameraLookAt(playerid, 2288.0, 2422.3, 12.0);
        }
        case ClassMafia:
        {
            // Create a Sandking for class-selection, and put the player inside to make it appear
            if ((APlayerData[playerid][PlayerClass] != LastClass) || (VehicleSpawned == false))
                AClassSelectionVehicles[playerid][0] = Vehicle_CreateCS(playerid, 495, 2823.7, 921.7, 11.1, 228.0, 0, 0);
            SetPlayerPos(playerid, 2823.4, 918.0, 10.75);
            SetPlayerFacingAngle(playerid, 180.0);
            SetPlayerCameraPos(playerid, 2822.7, 911.5, 10.75);
            SetPlayerCameraLookAt(playerid, 2823.4, 918.0, 10.75);
        }
        case ClassCourier:
        {
            // Create a Faggio and Burrito for class-selection, and put the player inside to make them appear
            if ((APlayerData[playerid][PlayerClass] != LastClass) || (VehicleSpawned == false))
            {
                AClassSelectionVehicles[playerid][0] = Vehicle_CreateCS(playerid, 462, -1855.0, -139.0, 11.49, 51.5, 1, 2);
                AClassSelectionVehicles[playerid][1] = Vehicle_CreateCS(playerid, 482, -1850.6, -139.0, 12.01, 340.0, 1, 2);
            }
            SetPlayerPos(playerid, -1853.3, -138.0, 11.9);
            SetPlayerFacingAngle(playerid, 15.0);
            SetPlayerCameraPos(playerid, -1855.0, -130.7, 11.9);
            SetPlayerCameraLookAt(playerid, -1853.3, -138.0, 11.9);
        }
        case ClassAssistance:
        {
            // Create a Towtruck for class-selection, and put the player inside to make it appear
            if ((APlayerData[playerid][PlayerClass] != LastClass) || (VehicleSpawned == false))
                AClassSelectionVehicles[playerid][0] = Vehicle_CreateCS(playerid, 525, -1903.9, 271.8, 40.91, 126.0, 1, 2);
            SetPlayerPos(playerid, -1903.8, 267.4, 41.0);
            SetPlayerFacingAngle(playerid, 162.0);
            SetPlayerCameraPos(playerid, -1906.3, 259.8, 40.3);
            SetPlayerCameraLookAt(playerid, -1903.8, 267.4, 41.0);
        }
        case ClassRoadworker:
        {
            // Create a xxx for class-selection, and put the player inside to make them appear
            if ((APlayerData[playerid][PlayerClass] != LastClass) || (VehicleSpawned == false))
            {
                AClassSelectionVehicles[playerid][0] = Vehicle_CreateCS(playerid, 552, -1877.4, -1719.4, 21.43, 59.95, 1, 2);
                AClassSelectionVehicles[playerid][1] = Vehicle_CreateCS(playerid, 611, -1872.8, -1722.1, 21.4, 59.95, 1, 2);
            }
            SetPlayerPos(playerid, -1879.5, -1723.7, 21.75);
            SetPlayerFacingAngle(playerid, 133.0);
            SetPlayerCameraPos(playerid, -1886.1, -1729.5, 21.75);
            SetPlayerCameraLookAt(playerid, -1879.5, -1723.7, 23.0);
        }
    }

    return 1;
}


Add this function below OnPlayerRequestClass:
pawn Code:
// This function is only used during class-selection
Vehicle_CreateCS(playerid, vModel, Float:x, Float:y, Float:z, Float:rot, Col1, Col2)
{
    // Create the given vehicle at the given coordinates
    new vid = CreateVehicle(vModel, x, y, z, rot, Col1, Col2, 60);
    // Set the vehicle in the player's virtual world for class-selection
    SetVehicleVirtualWorld(vid, 15000 + playerid);
    // Put the player inside the vehicle to make it appear
    PutPlayerInVehicle(playerid, vid, 0);
    // Return the vehicle-id
    return vid;
}

Finally, Inside the callback OnPlayerRequestSpawn, you'll find this:
pawn Code:
// 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;
}
Add this code just above it:
pawn Code:
// Delete both class-selection vehicles if they exist
    for (new i; i < 2; i++)
    {
        if (AClassSelectionVehicles[playerid][i] != 0)
        {
            DestroyVehicle(AClassSelectionVehicles[playerid][i]);
            AClassSelectionVehicles[playerid][i] = 0;
        }
    }


Then compile the gamemode.
It should work without errors.
If you get errors, please let me know.
HTML Code:
C:\Users\ACER\Desktop\Всякакви работи\truck\gamemodes\aG.pwn(2702) : error 017: undefined symbol "ClassTrucker"
C:\Users\ACER\Desktop\Всякакви работи\truck\gamemodes\aG.pwn(2715) : error 017: undefined symbol "ClassBusdriver"
C:\Users\ACER\Desktop\Всякакви работи\truck\gamemodes\aG.pwn(2771) : error 017: undefined symbol "ClassRoadworker"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
line
2702 case ClassTrucker:
2715 case ClassBusdriver:
2771 case ClassRoadworker:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)