Npc and trailer
#1

HI, i have one problem!
I created npc it works great, but it should drive a truck with trailer. However it doesn't. Maybe its imposable?
P.S. I recorded it with trailer.

maybe this helps:
pawn Код:
sunk = AddStaticVehicle(515,-2581.0857,1145.5331,60.3293,325.3235,-1,-1);
    priekaba = AddStaticVehicle(435,-2565.5623,1133.8135,55.4133,247.9579,-1,-1);
pawn Код:
ConnectNPC("Jonas_Betas","fura");
pawn Код:
if(!strcmp(playername,"Jonas_Betas",true))
{
SetSpawnInfo( playerid, 0, 101, 1958.33, 1343.12, 15.36, 269.15, 31, 1000, 0, 0, 0, 0 );
PutPlayerInVehicle(playerid,sunk, 0);
AttachTrailerToVehicle(priekaba, sunk);
}
Reply
#2

Try placing the AttachTrailerToVehicle function in OnPLayerStateChange, be sure to add the player state conditional for driving, example:
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(!strcmp(playername,"Jonas_Betas",true))
    {
        if(newstate==PLAYER_STATE_DRIVER)AttachTrailerToVehicle(priekaba, sunk);
    }
}
Reply
#3

nah.. it isn't work.... but thx for the help.

EDIT: i tried to create zcmd command ant its work.. so maybe there is some way to 'create a direction' for that command in GameModeInit or in
pawn Код:
if(!strcmp(playername,"Jonas_Betas",true))
{
SetSpawnInfo( playerid, 0, 101, 1958.33, 1343.12, 15.36, 269.15, 31, 1000, 0, 0, 0, 0 );
PutPlayerInVehicle(playerid,sunk, 0);
AttachTrailerToVehicle(priekaba, sunk);
}?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)