Vehicle Owner name??
#1

How to make it like when someone is online the vehicles spawn( in my script) and that there stand: Car owner: "Ownername" Who can make that for me? Or explain it?


Code for cardata:
pawn Код:
House_ReplaceVehicle(HouseID, CarSlot)
{
    // Setup local variables
    new vid, cModel, cPaint, cComponents[14], Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2, Float:Health, cFuel;
    new panels, doors, lights, tires;

    // Get the data from the already existing vehicle that was parked before
    vid = AHouseData[HouseID][VehicleIDs][CarSlot];
    cModel = AVehicleData[vid][Model];
    cPaint = AVehicleData[vid][PaintJob];
    cFuel = AVehicleData[vid][Fuel];
    for (new i; i < 14; i++)
        cComponents[i] = AVehicleData[vid][Components][i];
    Col1 = AVehicleData[vid][Color1];
    Col2 = AVehicleData[vid][Color2];
    cx = AVehicleData[vid][SpawnX];
    cy = AVehicleData[vid][SpawnY];
    cz = AVehicleData[vid][SpawnZ];
    crot = AVehicleData[vid][SpawnRot];
    GetVehicleHealth(vid, Health);
    GetVehicleDamageStatus(vid, panels, doors, lights, tires);

    // Delete the vehicle and clear the data
    Vehicle_Delete(vid);

    // Create a new vehicle in the same carslot
    vid = House_AddVehicle(HouseID, cModel, cPaint, cComponents, Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2);
    // Update the fuel of the vehicle to the previous setting
    AVehicleData[vid][Fuel] = cFuel;
    // Update the health to what it was before and update the bodywork
    SetVehicleHealth(vid, Health);
    UpdateVehicleDamageStatus(vid, panels, doors, lights, tires);

    return vid;
}
EDIT and there is a define:

pawn Код:
// Setup a custom type to hold all data about a vehicle
enum TVehicleData
{
    bool:MafiaLoad, // Holds True if the vehicle (or trailer) is carrying a mafia-wanted load
    Fuel, // Holds the amount of fuel for this vehicle
    BelongsToHouse, // Holds the HouseID to which this vehicle belongs
    bool:StaticVehicle, // Holds true if this is a static vehicle
    bool:Owned, // Holds true if the vehicle is owned by somebody
    Owner[24], // Holds the name of the owned of the vehicle
    Model, // Holds the vehicle-model of this vehicle
    PaintJob, // Holds the ID of the paintjob applied to the vehicle
    Components[14], // Holds all Component-ID's for all components on the vehicle
    Color1, // Holds the primary color for this vehicle
    Color2, // Holds the secundairy color for this vehicle
    NeonLeft, // Holds the neon-object on the left side
    NeonRight, // Holds the neon-object on the right side
    Float:SpawnX, // Holds the X-coordinate of the parking spot for this vehicle
    Float:SpawnY, // Holds the Y-coordinate of the parking spot for this vehicle
    Float:SpawnZ, // Holds the Z-coordinate of the parking spot for this vehicle
    Float:SpawnRot, // Holds the rotation of the parking spot for this vehicle
    bool:Clamped // Holds "true" if the vehicle is clamped by an admin
}
Reply
#2

Someone? I need it fast!

Ty.
Reply
#3

The end of day 2 still no answers.. Please help me figure this out. Thanks.

Sorry for the BUMP.
Reply
#4

What exactly do you want? Please explain a bit better.
Reply
#5

I want it that players can see the owner name with a 3d textlabel or something similar with it.
Reply
#6

Someone know's how to do this?
Reply
#7

Don't bump the topics so fast, you are no VIP. There are tons of people waiting the list down there to get their problems solved.
Reply
#8

Ok, then I will bump this topic now after 72 hours. :P
Reply
#9

In That Function
pawn Код:
if(_:AVehicleData[vid][ZaText] != 0)Delete3DTextLabel(AVehicleData[vid][ZaText]);
vid = House_AddVehicle(HouseID, cModel, cPaint, cComponents, Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2);///reference this line
new string[50];format(string, 50, "Owner:{77FF00}%s",AVehicleData[vid][Owner]);
AVehicleData[vid][ZaText] = Create3DTextLabel(string,0xFF0000FF,cx,cy,cz,40,1);
Attach3DTextLabelToVehicle(AVehicleData[vid][ZaText],vid,0.0,0.0,+0.4);
In Enum:
pawn Код:
Text3D:ZaText
I king this is what you want.
Reply
#10

Thanks alot, but getting some errors.

Код:
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\pawno\include\PPC_Housing.inc(292) : error 029: invalid expression, assumed zero
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\pawno\include\PPC_Housing.inc(292) : warning 215: expression has no effect
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\pawno\include\PPC_Housing.inc(292) : error 001: expected token: ";", but found ")"
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\pawno\include\PPC_Housing.inc(292) : error 029: invalid expression, assumed zero
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\pawno\include\PPC_Housing.inc(292) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
The script with line 292:
pawn Код:
if(_:AVehicleData[vid][ZaText] != 0)Delete3DTextLabel(AVehicleData[vid][ZaText]);
    vid = House_AddVehicle(HouseID, cModel, cPaint, cComponents, Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2);///reference this line
    new string[50];format(string, 50, "Owner:{77FF00}%s",AVehicleData[vid][Owner]);
    AVehicleData[vid][ZaText] = Create3DTextLabel(string,0xFF0000FF,cx,cy,cz,40,1);
    Attach3DTextLabelToVehicle(AVehicleData[vid][ZaText],vid,0.0,0.0,+0.4); //line 292
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)