3D Text label doesnt get deleted why!?
#1

Okay this is my code
pawn Код:
House_AddVehicle(HouseID, cModel, cPaint, cComponents[], Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2)
{
    // Setup local variables
    new vid, CarSlot;
    new string[40];
   

    // Get a free carslot from the house
    CarSlot = House_GetFreeCarSlot(HouseID);

    // Check if there is a free carslot
    if (CarSlot != -1)
    {
        // Create a new vehicle and get the vehicle-id
        vid = CreateVehicle(cModel, cx, cy, cz, crot, Col1, Col2, 600);
        // Store the vehicle-id in the house's free carslot
        AHouseData[HouseID][VehicleIDs][CarSlot] = vid;

        // Save the model of the vehicle
        AVehicleData[vid][Model] = cModel;
        // Save the paintjob of the vehicle and apply it
        AVehicleData[vid][PaintJob] = cPaint;
        if (cPaint != 0)
            ChangeVehiclePaintjob(vid, cPaint - 1);

        // Also update the car-color
        ChangeVehicleColor(vid, Col1, Col2);
        // Save the colors of the vehicle
        AVehicleData[vid][Color1] = Col1;
        AVehicleData[vid][Color2] = Col2;

        // Save the components of the vehicle and apply them
        for (new i; i < 14; i++)
        {
            AVehicleData[vid][Components][i] = cComponents[i];
            // Check if the componentslot has a valid component-id
            if (AVehicleData[vid][Components][i] != 0)
                AddVehicleComponent(vid, AVehicleData[vid][Components][i]); // Add the component to the vehicle
        }
        format(string, sizeof(string), "Vehicle owned by: %s", AHouseData[HouseID][Owner]);
        Car3DText[playerid] = Create3DTextLabel(string,0xAA3333AA,0,0,0,100.0,0);
        Attach3DTextLabelToVehicle(Car3DText[playerid], vid, 0,0,0);
        // Save the spawn-data of the vehicle
        AVehicleData[vid][SpawnX] = cx;
        AVehicleData[vid][SpawnY] = cy;
        AVehicleData[vid][SpawnZ] = cz;
        AVehicleData[vid][SpawnRot] = crot;
        // Also set the fuel to maximum
        AVehicleData[vid][Fuel] = MaxFuel;
        // Also set the owner
        AVehicleData[vid][Owned] = true;
        format(AVehicleData[vid][Owner], 24, AHouseData[HouseID][Owner]);
        // Save the HouseID for the vehicle
        AVehicleData[vid][BelongsToHouse] = HouseID;
    }
    else // No free carslot was found, return 0
        return 0;

    // Exit the function and return the vehicle-id
    return vid;
}
But because there is no playerid in the header its not working i get these errors:
Код:
C:\Users\Thimo\Desktop\Mappen\Samp 2\Backup\pawno\include\PPC_Housing.inc(244) : error 017: undefined symbol "playerid"
C:\Users\Thimo\Desktop\Mappen\Samp 2\Backup\pawno\include\PPC_Housing.inc(245) : error 017: undefined symbol "playerid"
C:\Users\Thimo\Desktop\Mappen\Samp 2\Backup\pawno\include\PPC_Housing.inc(293) : warning 202: number of arguments does not match definition
C:\Users\Thimo\Desktop\Mappen\Samp 2\Backup\pawno\include\PPC_Housing.inc(270) : warning 203: symbol is never used: "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
But if i place Playerid in the header it gets 2 warns :S
Код:
C:\Users\Thimo\Desktop\Mappen\Samp 2\Backup\pawno\include\PPC_FileOperations.inc(442) : warning 202: number of arguments does not match definition
C:\Users\Thimo\Desktop\Mappen\Samp 2\Backup\pawno\include\PPC_Dialogs.inc(1564) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
And if i change these lines i get even more errors
anyone know how to fix this? Please react..
Reply
#2

Quote:
Originally Posted by thimo
Посмотреть сообщение
Okay this is my code
pawn Код:
House_AddVehicle(HouseID, cModel, cPaint, cComponents[], Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2)
{
    // Setup local variables
    new vid, CarSlot;
    new string[40];
   

    // Get a free carslot from the house
    CarSlot = House_GetFreeCarSlot(HouseID);

    // Check if there is a free carslot
    if (CarSlot != -1)
    {
        // Create a new vehicle and get the vehicle-id
        vid = CreateVehicle(cModel, cx, cy, cz, crot, Col1, Col2, 600);
        // Store the vehicle-id in the house's free carslot
        AHouseData[HouseID][VehicleIDs][CarSlot] = vid;

        // Save the model of the vehicle
        AVehicleData[vid][Model] = cModel;
        // Save the paintjob of the vehicle and apply it
        AVehicleData[vid][PaintJob] = cPaint;
        if (cPaint != 0)
            ChangeVehiclePaintjob(vid, cPaint - 1);

        // Also update the car-color
        ChangeVehicleColor(vid, Col1, Col2);
        // Save the colors of the vehicle
        AVehicleData[vid][Color1] = Col1;
        AVehicleData[vid][Color2] = Col2;

        // Save the components of the vehicle and apply them
        for (new i; i < 14; i++)
        {
            AVehicleData[vid][Components][i] = cComponents[i];
            // Check if the componentslot has a valid component-id
            if (AVehicleData[vid][Components][i] != 0)
                AddVehicleComponent(vid, AVehicleData[vid][Components][i]); // Add the component to the vehicle
        }
        format(string, sizeof(string), "Vehicle owned by: %s", AHouseData[HouseID][Owner]);
        Car3DText[playerid] = Create3DTextLabel(string,0xAA3333AA,0,0,0,100.0,0);
        Attach3DTextLabelToVehicle(Car3DText[playerid], vid, 0,0,0);
        // Save the spawn-data of the vehicle
        AVehicleData[vid][SpawnX] = cx;
        AVehicleData[vid][SpawnY] = cy;
        AVehicleData[vid][SpawnZ] = cz;
        AVehicleData[vid][SpawnRot] = crot;
        // Also set the fuel to maximum
        AVehicleData[vid][Fuel] = MaxFuel;
        // Also set the owner
        AVehicleData[vid][Owned] = true;
        format(AVehicleData[vid][Owner], 24, AHouseData[HouseID][Owner]);
        // Save the HouseID for the vehicle
        AVehicleData[vid][BelongsToHouse] = HouseID;
    }
    else // No free carslot was found, return 0
        return 0;

    // Exit the function and return the vehicle-id
    return vid;
}
But because there is no playerid in the header its not working i get these errors:
Код:
C:\Users\Thimo\Desktop\Mappen\Samp 2\Backup\pawno\include\PPC_Housing.inc(244) : error 017: undefined symbol "playerid"
C:\Users\Thimo\Desktop\Mappen\Samp 2\Backup\pawno\include\PPC_Housing.inc(245) : error 017: undefined symbol "playerid"
C:\Users\Thimo\Desktop\Mappen\Samp 2\Backup\pawno\include\PPC_Housing.inc(293) : warning 202: number of arguments does not match definition
C:\Users\Thimo\Desktop\Mappen\Samp 2\Backup\pawno\include\PPC_Housing.inc(270) : warning 203: symbol is never used: "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
But if i place Playerid in the header it gets 2 warns :S
Код:
C:\Users\Thimo\Desktop\Mappen\Samp 2\Backup\pawno\include\PPC_FileOperations.inc(442) : warning 202: number of arguments does not match definition
C:\Users\Thimo\Desktop\Mappen\Samp 2\Backup\pawno\include\PPC_Dialogs.inc(1564) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
And if i change these lines i get even more errors
anyone know how to fix this? Please react..
I don't know if will it work, just test.

pawn Код:
House_AddVehicle(HouseID, cModel, cPaint, cComponents[], Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2)
{
    // Setup local variables
    new vid, CarSlot;
    new string[40];
   

    // Get a free carslot from the house
    CarSlot = House_GetFreeCarSlot(HouseID);

    // Check if there is a free carslot
    if (CarSlot != -1)
    {
        // Create a new vehicle and get the vehicle-id
        vid = CreateVehicle(cModel, cx, cy, cz, crot, Col1, Col2, 600);
        // Store the vehicle-id in the house's free carslot
        AHouseData[HouseID][VehicleIDs][CarSlot] = vid;

        // Save the model of the vehicle
        AVehicleData[vid][Model] = cModel;
        // Save the paintjob of the vehicle and apply it
        AVehicleData[vid][PaintJob] = cPaint;
        if (cPaint != 0)
            ChangeVehiclePaintjob(vid, cPaint - 1);

        // Also update the car-color
        ChangeVehicleColor(vid, Col1, Col2);
        // Save the colors of the vehicle
        AVehicleData[vid][Color1] = Col1;
        AVehicleData[vid][Color2] = Col2;

        // Save the components of the vehicle and apply them
        for (new i; i < 14; i++)
        {
            AVehicleData[vid][Components][i] = cComponents[i];
            // Check if the componentslot has a valid component-id
            if (AVehicleData[vid][Components][i] != 0)
                AddVehicleComponent(vid, AVehicleData[vid][Components][i]); // Add the component to the vehicle
                format(string, sizeof(string), "Vehicle owned by: %s", AHouseData[HouseID][Owner]);
                Car3DText[i] = Create3DTextLabel(string,0xAA3333AA,0,0,0,100.0,0);
                Attach3DTextLabelToVehicle(Car3DText[i], vid, 0,0,0);
        }
        // Save the spawn-data of the vehicle
        AVehicleData[vid][SpawnX] = cx;
        AVehicleData[vid][SpawnY] = cy;
        AVehicleData[vid][SpawnZ] = cz;
        AVehicleData[vid][SpawnRot] = crot;
        // Also set the fuel to maximum
        AVehicleData[vid][Fuel] = MaxFuel;
        // Also set the owner
        AVehicleData[vid][Owned] = true;
        format(AVehicleData[vid][Owner], 24, AHouseData[HouseID][Owner]);
        // Save the HouseID for the vehicle
        AVehicleData[vid][BelongsToHouse] = HouseID;
    }
    else // No free carslot was found, return 0
        return 0;

    // Exit the function and return the vehicle-id
    return vid;
}
Reply
#3

Thanks for trying to help but i get these errors:
Код:
C:\Users\Thimo\Desktop\Mappen\Samp 2\Backup\pawno\include\PPC_Housing.inc(243) : error 017: undefined symbol "playerid"
C:\Users\Thimo\Desktop\Mappen\Samp 2\Backup\pawno\include\PPC_Housing.inc(244) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#4

Change this:

PHP код:
Car3DText[playerid] = Create3DTextLabel(string,0xAA3333AA,0,0,0,100.0,0);
Attach3DTextLabelToVehicle(Car3DText[playerid], vid0,0,0); 
For this:

PHP код:
Car3DText[vid] = Create3DTextLabel(string,0xAA3333AA,0,0,0,100.0,0);
Attach3DTextLabelToVehicle(Car3DText[vid], vid0,0,0); 
Reply
#5

Well at on disconnect just should be Delete3DTextLabel(Car3DText);? or i gotta do Delete3DTextLabel(Car3DText[vid]); < This one gives me errors
Reply
#6

Its not working... i get no errors or anything... But label isnt showing up
Help :S
pawn Код:
new Text3D:Car3DText[MAX_PLAYERS];
// This function adds a vehicle to the house (if possible)
House_AddVehicle(HouseID, cModel, cPaint, cComponents[], Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2)
{
    // Setup local variables
    new vid, CarSlot;
    new string[40];
   

    // Get a free carslot from the house
    CarSlot = House_GetFreeCarSlot(HouseID);

    // Check if there is a free carslot
    if (CarSlot != -1)
    {
        // Create a new vehicle and get the vehicle-id
        vid = CreateVehicle(cModel, cx, cy, cz, crot, Col1, Col2, 600);
        // Store the vehicle-id in the house's free carslot
        AHouseData[HouseID][VehicleIDs][CarSlot] = vid;

        // Save the model of the vehicle
        AVehicleData[vid][Model] = cModel;
        // Save the paintjob of the vehicle and apply it
        AVehicleData[vid][PaintJob] = cPaint;
        if (cPaint != 0)
            ChangeVehiclePaintjob(vid, cPaint - 1);

        // Also update the car-color
        ChangeVehicleColor(vid, Col1, Col2);
        // Save the colors of the vehicle
        AVehicleData[vid][Color1] = Col1;
        AVehicleData[vid][Color2] = Col2;

        // Save the components of the vehicle and apply them
        for (new i; i < 14; i++)
        {
            AVehicleData[vid][Components][i] = cComponents[i];
            // Check if the componentslot has a valid component-id
            if (AVehicleData[vid][Components][i] != 0)
                AddVehicleComponent(vid, AVehicleData[vid][Components][i]); // Add the component to the vehicle
        }
        format(string, sizeof(string), "Vehicle owned by: %s", AHouseData[HouseID][Owner]);
        Car3DText[vid] = Create3DTextLabel(string,0xAA3333AA,0,0,0,100.0,0);
        Attach3DTextLabelToVehicle(Car3DText[vid], vid, 0,0,0);
        // Save the spawn-data of the vehicle
        AVehicleData[vid][SpawnX] = cx;
        AVehicleData[vid][SpawnY] = cy;
        AVehicleData[vid][SpawnZ] = cz;
        AVehicleData[vid][SpawnRot] = crot;
        // Also set the fuel to maximum
        AVehicleData[vid][Fuel] = MaxFuel;
        // Also set the owner
        AVehicleData[vid][Owned] = true;
        format(AVehicleData[vid][Owner], 24, AHouseData[HouseID][Owner]);
        // Save the HouseID for the vehicle
        AVehicleData[vid][BelongsToHouse] = HouseID;
    }
    else // No free carslot was found, return 0
        return 0;

    // Exit the function and return the vehicle-id
    return vid;
}
Reply
#7

BUMP
Reply
#8

HELP! :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)