SA-MP Forums Archive
[Help] Plate + Attach to Vehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Plate + Attach to Vehicle (/showthread.php?tid=194238)



[Help] Plate + Attach to Vehicle - XePloiT - 28.11.2010

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;
}



Re: [Help] Plate + Attach to Vehicle - Grim_ - 28.11.2010

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.


Re: [Help] Plate + Attach to Vehicle - WillyP - 28.11.2010

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.


Re: [Help] Plate + Attach to Vehicle - Grim_ - 28.11.2010

Sorry, I replied to the wrong person here lol..


Re: [Help] Plate + Attach to Vehicle - WillyP - 28.11.2010

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.


Re: [Help] Plate + Attach to Vehicle - XePloiT - 28.11.2010

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


Re: [Help] Plate + Attach to Vehicle - XePloiT - 28.11.2010

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


Re: [Help] Plate + Attach to Vehicle - XePloiT - 29.11.2010

please anyone? :\


Re: [Help] Plate + Attach to Vehicle - Vince - 29.11.2010

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


Re: [Help] Plate + Attach to Vehicle - XePloiT - 29.11.2010

@Vince : still doesn't work :\