Car View Problems
#1

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;
}
Reply
#2

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;
}
Reply
#3

THank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)