SA-MP Forums Archive
Set player in car - 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: Set player in car (/showthread.php?tid=210459)



Set player in car - Deal-or-die - 13.01.2011

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


Re: Set player in car - coole210 - 13.01.2011

Did you define "veh"?


Re: Set player in car - Deal-or-die - 13.01.2011

what would i define it as?
"new veh"?


Re: Set player in car - Toreno - 13.01.2011

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



Re: Set player in car - Deal-or-die - 13.01.2011

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


Re: Set player in car - Tee - 13.01.2011

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



Re: Set player in car - Deal-or-die - 13.01.2011

Thank you very much Tee they need a +rep lol


Re: Set player in car - Tee - 13.01.2011

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