[Help] Plate + Attach to Vehicle
#1

well i hate this code (i took it from somewhere in the forum just to test)
but this is doesn't work :\
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/att", cmdtext, true))
    {
        new Float:xt,Float:yt,Float:zt;
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_WHITE,"NOT IN A CAR");
        GetVehiclePos(TC,xt,yt,zt);
        new TO = CreatePlayerObject(playerid,615, Float:xt, Float:yt, Float:zt+5, 0, 0, 0);
        AttachObjectToVehicle(TO,TC,xt,yt,zt,20,20,20);
        return 1;
    }
    if (!strcmp("/sp", cmdtext, true))
        {
            if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,"You're not in a vehicle!");
            new string[60];
            format(string,60,"Input your new vehicle numberplate below.",string);
            ShowPlayerDialog(playerid,0,DIALOG_STYLE_INPUT,"{EE7777}Vehicle Numberplate",string,"Yes","Cancel");
            return 1;
        }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
        if(dialogid == 0) {
                if(response) {
                    SetVehicleNumberPlate(TC, inputtext);
                    SetVehicleToRespawn(GetPlayerVehicleID(playerid));
                        } else {
                        SendClientMessage(playerid,0xFFFFFFFF,"You cancelled!");
                        }
                }
        return 1;
}
Reply
#2

The object attachment is obviously not going to work unless you have already created and assigned an object to the variable 'TC'.

Also, you do not need to format that string.
Reply
#3

Quote:
Originally Posted by Grim_
Посмотреть сообщение
The object attachment is obviously not going to work unless you have already created and assigned an object to the variable 'TC'.

Also, you do not need to format that string.
I know, I don't understand why I formatted a string I didn't even need to assign.
Reply
#4

Sorry, I replied to the wrong person here lol..
Reply
#5

Quote:
Originally Posted by Grim_
Посмотреть сообщение
I think I know why...Because it's not your script. The same exact code can be found in a release under Filterscript and Includes board.
Maybe if you look, it is MY code.
Reply
#6

yes it is Victious's code... my point is why it is doesn't work?
BTW: TC=TestCar and OT=ObjectTest
Reply
#7

please can someone help me? i really want this to work :\
Reply
#8

please anyone? :\
Reply
#9

pawn Код:
AttachObjectToVehicle(TO,TC,xt,yt,zt,20,20,20);
Is obviously not going to work. Params 3, 4 and 5 are offsets. I.e. the exact middle of the car is 0.0, 0.0, 0.0
Reply
#10

@Vince : still doesn't work :\
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)