Car View Problems - 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)
+--- Thread: Car View Problems (
/showthread.php?tid=520425)
Car View Problems -
Pboachie - 18.06.2014
I compiled the Filescript and there were no errors but when i load it into my test server and give it a go, It dosent work like its supose to. In the code below, The drivers seat is 0 and when i tell it if the driver is in any other 1 and up, it shoudnt change views but it does.
Код:
new fps[MAX_PLAYERS]; //ON TOP OF SCRIPT
public OnPlayerEnterVehicle(playerid, vehicleid)
{
new iSeat = GetPlayerVehicleSeat(playerid);
if(iSeat >= 1) //if not in drivers seat
{
SendClientMessage(playerid, 0xFFFFFFFF, "No FPS for you");
}
else{ //if in drivers seat, Set in FPS
new p = vehicleid;
fps[playerid] = CreatePlayerObject(playerid,19300, 0.0000, -1282.9984, 10.1493, 0.0000, -1, -1, 100);
AttachPlayerObjectToVehicle(playerid,fps[playerid],p,-0.314999, -0.195000, 0.510000, 0.000000, 0.000000, 0.000000);
AttachCameraToPlayerObject(playerid,fps[playerid]);
}
return 1;
}
Re: Car View Problems -
SickAttack - 18.06.2014
This should work:
pawn Код:
new fps[MAX_PLAYERS];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
fps[playerid] = CreatePlayerObject(playerid, 19300, 0.0000, -1282.9984, 10.1493, 0.0000, -1, -1, 100);
AttachPlayerObjectToVehicle(playerid, fps[playerid], GetPlayerVehicleID(playerid), -0.314999, -0.195000, 0.510000, 0.000000, 0.000000, 0.000000);
AttachCameraToPlayerObject(playerid, fps[playerid]);
}
return 1;
}
Re: Car View Problems -
Pboachie - 19.06.2014
THank you