Set player in car
#1

ok i finally got my tele working but now im looking at how to set the player IN the car once it teleports because when you drive to the garage then type /enterhm or what ever it teleports you to the Hitman location this is ok but if your in a car it will place you either on top or inside(as in standing up in the middle of the car) the car, it would be cool if i could set the player inside the car at the same time so if i put this cmd
Код:
PutPlayerInVehicle(playerid, veh, 0);
is that what i should use or is there a cmd better than that one?

this is what my cmd looks like so far
pawn Код:
command(exithm, playerid, params[])
{
    if(!IsPlayerInRangeOfPoint(playerid, 5, -2093.0073,887.5366,1396.1660)) return SendClientMessage(playerid, 0xAFAFAFAA, "You are not at the exit!");
    {
        SendClientMessage(playerid, WHITE, "The word of your boss run through your head, kill or be killed");
        SetVehiclePos(GetPlayerVehicleID(playerid), -2073.8323, 972.0553, 62.9219);
        SetPlayerPos(playerid,-2073.8323, 972.0553, 62.9219);
        PutPlayerInVehicle(playerid, veh, 0);
    }
    return 1;
}
and these are my errors for this line "PutPlayerInVehicle(playerid, veh, 0);"
Код:
 error 017: undefined symbol "veh"
any ideas hugely appreciated thanks
Reply
#2

Did you define "veh"?
Reply
#3

what would i define it as?
"new veh"?
Reply
#4

You should create a vehicle using a var.
pawn Код:
new veh;
veh = CreateVehicle(...);
PutPlayerInVehicle(playerid, veh, 0);
Reply
#5

but the player could be in any car of their choice, im not wanting to set the players car
Reply
#6

pawn Код:
command(exithm, playerid, params[])
{
    if(!IsPlayerInRangeOfPoint(playerid, 5, -2093.0073,887.5366,1396.1660)) return SendClientMessage(playerid, 0xAFAFAFAA, "You are not at the exit!");
    {
        new veh = GetPlayerVehicleID(playerid);//Gets the id of any vehicle the player is in
        SendClientMessage(playerid, WHITE, "The word of your boss run through your head, kill or be killed");
        SetVehiclePos(veh, -2073.8323, 972.0553, 62.9219);
        SetPlayerPos(playerid,-2073.8323, 972.0553, 62.9219);
        PutPlayerInVehicle(playerid, veh, 0);
    }
    return 1;
}
Reply
#7

Thank you very much Tee they need a +rep lol
Reply
#8

No problem and what do you mean a "+ rep"?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)