doesnt attach 3dTextLabel to vehicle
#1

Hello, why does this command not place the 3d text label on the closest vehicle?

pawn Код:
if(strcmp(cmd, "/parkingticket", true) == 0)
    {
        new vehicleid=GetClosestCar(playerid);
        if(IsPlayerConnected(playerid))
        {
            if(gTeam[playerid] != 2)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not a Cop!");
                return 1;
            }
            if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not on Duty!");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, ""COL_SZR"Usage:"COL_WHITE" /parkingticket [price] [reason]");
                return 1;
            }
            new price;
            price = strval(tmp);
            if(price < 1 || price > 1000) { SendClientMessage(playerid, COLOR_GREY, "   The parking ticket price can't be below 1 or higher than 1000."); return 1; }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, ""COL_SZR"Usage:"COL_WHITE" /parkingticket [price] [reason]");
                return 1;
            }
            new Float:x, Float:y, Float:z;
            GetVehiclePos(vehicleid, x, y, z);
            format(string,sizeof(string),"Parking Ticket: Price: $%d Reason: %s", price, result);
            vehicle3Dtext[vehicleid] = Create3DTextLabel(string, TEAM_SAS_COLOR, x, y, z, 10, 0, 1);
            Attach3DTextLabelToVehicle(vehicle3Dtext[vehicleid], vehicleid, 0.0, -2.8, 0.0);
            CarInfo[vehicleid][cParkTicket] = 1;
            strmid(CarInfo[vehicleid][cPtText], result, 0, 64, 255);
            format(string, sizeof(string), "* %s writes down a parking ticket, and places it on the %s's windshield wiper.", RemoveUnderScore(playerid),vehName[GetVehicleModel(vehicleid)-400]);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            return 1;
        }
        return 1;
    }
Reply
#2

i will rep+
Reply
#3

24 hour bumps only.


And is this
PHP код:
format(stringsizeof(string), "* %s writes down a parking ticket, and places it on the %s's windshield wiper."RemoveUnderScore(playerid),vehName[GetVehicleModel(vehicleid)-400]); 
part of the code working?

Does it ID the "nearest vehicle", or is it returning nothing, or random models?
Reply
#4

its chosing the closest vehicle and it says that the ticket has been placed, but it just doesnt place the 3dtextlabel
Reply
#5

Are you using incognitos streamer elsewhere?
Reply
#6

Nope
Reply
#7

PHP код:
vehicle3Dtext[vehicleid] = Create3DTextLabel(stringTEAM_SAS_COLORxyz1000); 
Try that, if it works, it's the Line of Sight option in the 3DText.
Reply
#8

also, isnt that line exact the same as the one im using already
Reply
#9

Nope, its still now showing any label
Reply
#10

You can always use Incognito's streamer:

vehicle3Dtext[vehicleid] = CreateDynamic3DTextLabel(string, TEAM_SAS_COLOR, x, y, z, 10, .attachedvehicle = vehicleid, .testlos = 1);
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)