Put a player in 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: Put a player in vehicle (
/showthread.php?tid=81038)
Put a player in vehicle -
Snyper - 07.06.2009
I'm using a FS I put into my GM and I'm having trouble putting my player into the vehicle after he's done using the feature.
Quote:
if (strcmp("/cameraon", cmdtext, true) == 0)
{
if(Spawned[playerid] == 1)
{
if(PlayerInfo[playerid][pJob] != 7)
{
SendClientMessage(playerid, COLOR_GREY, "[ERROR:] You're not a Reporter!");
return 1;
}
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 582)
{
PlayerMenu[playerid] = 0;
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(CCTVMenu[0], playerid);
}
else
{
SendClientMessage(playerid,COLOR_LIGHTYELLOW2, "[INFO:] You're not in a News Reporter Van!");
}
}
return 1;
}
|
Quote:
if (strcmp("/cameraoff", cmdtext, true) == 0)
{
if(CurrentCCTV[playerid] > -1)
{
SetPlayerPos(playerid, LastPos[playerid][LX], LastPos[playerid][LY], LastPos[playerid][LZ]);
SetPlayerFacingAngle(playerid, LastPos[playerid][LA]);
SetPlayerInterior(playerid, LastPos[playerid][LInterior]);
TogglePlayerControllable(playerid, 1);
KillTimer(KeyTimer[playerid]);
SetCameraBehindPlayer(playerid);
TextDrawHideForPlayer(playerid, TD);
CurrentCCTV[playerid] = -1;
return 1;
}
}
|
How do I make it so he returns to his vehicle after he's done using the command?
Re: Put a player in vehicle -
Correlli - 07.06.2009
By using
PutPlayerInVehicle.
Re: Put a player in vehicle -
Snyper - 08.06.2009
I did that but it's not working. I'm sure exactly what I'm supposed to do...
Re: Put a player in vehicle -
efeX - 08.06.2009
Did you read the wiki link...
Re: Put a player in vehicle -
Gappy - 08.06.2009
Use GetPlayerVehicleID on /cameraon, and on /cameroff put the player back in the same vehicle using PutPlayerInVehicle
Re: Put a player in vehicle -
Correlli - 08.06.2009
Quote:
Originally Posted by Snyper
I did that but it's not working.
|
It does. I'm sure you didn't used it correctly.
Re: Put a player in vehicle -
Snyper - 08.06.2009
I'm sorry. I'm having an embarassing moment right now. I can usually fix things pretty well by myself but, I'm having a brain fart.
Can someone just do it for me? I'll learn from it more then the frustration that it's causing to make it work.
Re: Put a player in vehicle -
AiVAMAN - 08.06.2009
where exactly he sould get put in the vehicle?
Re: Put a player in vehicle -
Snyper - 08.06.2009
I want him to get the vehicle id when he uses /cameraon and when he writes /cameroff he returns back to his previous vehicle.
Right now when the person writes /cameron the person gets teleported somewhere, and returns later. He's in the driver seat.
Re: Put a player in vehicle -
Correlli - 08.06.2009
SA-MP doesn't have function which could detect on which seat was he sitting unless you make your own function which will store player's seatid.