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


Messages In This Thread
doesnt attach 3dTextLabel to vehicle - by MayaEU - 30.06.2016, 19:15
Re: doesnt attach 3dTextLabel to vehicle - by MayaEU - 30.06.2016, 19:39
Re: doesnt attach 3dTextLabel to vehicle - by Sew_Sumi - 30.06.2016, 20:04
Re: doesnt attach 3dTextLabel to vehicle - by MayaEU - 30.06.2016, 20:20
Re: doesnt attach 3dTextLabel to vehicle - by Sew_Sumi - 30.06.2016, 21:44
Re: doesnt attach 3dTextLabel to vehicle - by MayaEU - 01.07.2016, 11:00
Re: doesnt attach 3dTextLabel to vehicle - by Sew_Sumi - 01.07.2016, 11:14
Re: doesnt attach 3dTextLabel to vehicle - by MayaEU - 01.07.2016, 11:46
Re: doesnt attach 3dTextLabel to vehicle - by MayaEU - 01.07.2016, 12:17
Re: doesnt attach 3dTextLabel to vehicle - by Jingles - 01.07.2016, 13:40

Forum Jump:


Users browsing this thread: 2 Guest(s)