3d text
#1

Quote:

public OnVehicleStreamIn(vehicleid, forplayerid)
{
PlayerLoop(i)
{
new Float:tmpx, Float:tmpy, Float:tmpz;
GetVehiclePos(i, tmpx, tmpy, tmpz);
if(GetVehicleModel(i) == 402 || GetVehicleModel(i) == 477 || GetVehicleModel(i) == 560 || GetVehicleModel(i) == 487 || GetVehicleModel(i) == 522)
{
new Text3D:label = Create3DTextLabel("Yakuza Transportas", ySpalva,tmpx,tmpy,tmpz,20,0,1);
Attach3DTextLabelToVehicle(Text3D:label, i, 0, 0, 0);
}
else if(GetVehicleModel(i) == 411 || GetVehicleModel(i) == 480 || GetVehicleModel(i) == 495 || GetVehicleModel(i) == 541 || GetVehicleModel(i) == 563)
{
new Text3D:label = Create3DTextLabel("La Cosa Nostra Transportas", lSpalva,tmpx,tmpy,tmpz,20,0,1);
Attach3DTextLabelToVehicle(Text3D:label, i, 0, 0, 0);
}
else if(GetVehicleModel(i) == 523 || GetVehicleModel(i) == 497 || GetVehicleModel(i) == 427 || GetVehicleModel(i) == 599 || GetVehicleModel(i) == 597 || GetVehicleModel(i) == 490)
{
new Text3D:label = Create3DTextLabel("Policijos Departamento Transportas", mSpalva,tmpx,tmpy,tmpz,20,0,1);
Attach3DTextLabelToVehicle(Text3D:label, i, 0, 0, 0);
}
else if(GetVehicleModel(i) == 562 || GetVehicleModel(i) == 421 || GetVehicleModel(i) == 451 || GetVehicleModel(i) == 493 || GetVehicleModel(i) == 521)
{
new Text3D:label = Create3DTextLabel("Triads Transportas", tSpalva,tmpx,tmpy,tmpz,20,0,1);
Attach3DTextLabelToVehicle(Text3D:label, i, 0, 0, 0);
}
else if(GetVehicleModel(i) == AndriusZI)
{
new Text3D:label = Create3DTextLabel("AndriusZ Transportas", aSpalva,tmpx,tmpy,tmpz,20,0,1);
Attach3DTextLabelToVehicle(Text3D:label, i, 0, 0, 0);
}
else if(GetVehicleModel(i) == DeluxXxN)
{
new Text3D:label = Create3DTextLabel("DeluxXx Transportas", dSpalva,tmpx,tmpy,tmpz,20,0,1);
Attach3DTextLabelToVehicle(Text3D:label, i, 0, 0, 0);
}
else if(GetVehicleModel(i) == 432 || GetVehicleModel(i) == 520 || GetVehicleModel(i) == 447)
{
new Text3D:label = Create3DTextLabel("Spec. Transportas / lлktuvai", aSpalva,tmpx,tmpy,tmpz,20,0,1);
Attach3DTextLabelToVehicle(Text3D:label, i, 0, 0, 0);
}
}
return 1;
}

whats wrong with it 3d label didnt showing;s im tryied all labels do with if, but it doesnt working;/
Reply
#2

What's the error message ?
Reply
#3

Do every label seperatly -.-,

Like

new Text3D:label1

new Text3D:label2

new Text3D:label3

They cant all be the same or they'll overlap ect
Reply
#4

Nop, didnt working -,-
Reply
#5

Are you making a label for each player? you only need to make one label for each car. ( if I read your code correctly )
Reply
#6

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    new
        i,
        model,
        Float:vehx,
        Float:vehy,
        Float:vehz,
        Text3D:label;
    for (i = 0; i < MAX_VEHICLES; ++i)
    {
        model = GetVehicleModel(i);
        if (!model) break;
        label = 0;
        GetVehiclePos(i, vehx, vehy, vehz);
        switch (model)
        {
            case 402, 477, 487, 522, 560: label = Create3DTextLabel("Yakuza Transportas", ySpalva, vehx, vehy, vehz, 20.0, 0, 1);
            case 411, 480, 495, 541, 563: label = Create3DTextLabel("La Cosa Nostra Transportas", lSpalva, vehx, vehy, vehz, 20.0, 0, 1);
            case 427, 490, 497, 523, 597, 599: label = Create3DTextLabel("Policijos Departamento Transportas", mSpalva, vehx, vehy, vehz, 20.0, 0, 1);
            case 421, 451, 493, 521, 562: label = Create3DTextLabel("Triads Transportas", tSpalva, vehx, vehy, vehz, 20.0, 0, 1);
            case 432, 447, 520: label = Create3DTextLabel("Spec. Transportas / lлktuvai", aSpalva, vehx, vehy, vehz, 20.0, 0, 1);
            case AndriusZI: label = Create3DTextLabel("AndriusZ Transportas", aSpalva, vehx, vehy, vehz, 20.0, 0, 1);
            case DeluxXxN: label = Create3DTextLabel("DeluxXx Transportas", dSpalva, vehx, vehy, vehz, 20.0, 0, 1);
        }
        if (label) Attach3DTextLabelToVehicle(label, i, 0.0, 0.0, 3.0);
    }
    return 1;
}
untested
Reply
#7

Im just wanna attach 3d text to car -,-

Quote:

C:\Documents and Settings\Admin\Desktop\Backupai\Backupai\GangWars\ gamemodes\GangWars.pwn(2277) : warning 213: tag mismatch
C:\Documents and Settings\Admin\Desktop\Backupai\Backupai\GangWars\ gamemodes\GangWars.pwn(2286) : error 008: must be a constant expression; assumed zero
C:\Documents and Settings\Admin\Desktop\Backupai\Backupai\GangWars\ gamemodes\GangWars.pwn(2287) : error 008: must be a constant expression; assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

Reply
#8

try this

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    new
        i,
        model,
        Float:vehx,
        Float:vehy,
        Float:vehz;
    for (i = 0; i < MAX_VEHICLES; ++i)
    {
        new
            Text3D:label;
        model = GetVehicleModel(i);
        if (!model) break;
        GetVehiclePos(i, vehx, vehy, vehz);
        switch (model)
        {
            case 402, 477, 487, 522, 560: label = Create3DTextLabel("Yakuza Transportas", ySpalva, vehx, vehy, vehz, 20.0, 0, 1);
            case 411, 480, 495, 541, 563: label = Create3DTextLabel("La Cosa Nostra Transportas", lSpalva, vehx, vehy, vehz, 20.0, 0, 1);
            case 427, 490, 497, 523, 597, 599: label = Create3DTextLabel("Policijos Departamento Transportas", mSpalva, vehx, vehy, vehz, 20.0, 0, 1);
            case 421, 451, 493, 521, 562: label = Create3DTextLabel("Triads Transportas", tSpalva, vehx, vehy, vehz, 20.0, 0, 1);
            case 432, 447, 520: label = Create3DTextLabel("Spec. Transportas / lлktuvai", aSpalva, vehx, vehy, vehz, 20.0, 0, 1);
        }
        if (model == AndriusZI) label = Create3DTextLabel("AndriusZ Transportas", aSpalva, vehx, vehy, vehz, 20.0, 0, 1);
        else if (model == DeluxXxN) label = Create3DTextLabel("DeluxXx Transportas", dSpalva, vehx, vehy, vehz, 20.0, 0, 1);
        if (label) Attach3DTextLabelToVehicle(label, i, 0.0, 0.0, 3.0);
    }
    return 1;
}
Reply
#9

didnt showing:/
Reply
#10

Try this:
new string[ 128 ];
format(string, sizeof(string), "Yakuza Transportas");
new Text3D:label = Create3DTextLabel(string, ySpalva,tmpx,tmpy,tmpz,20,0,1);
Attach3DTextLabelToVehicle(Text3D:label, i, 0, 0, 0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)