24.04.2012, 19:19
Try this
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,-1,"Trebuie sa fiti la volan.");
if(!GetPVarInt(playerid,"used"))
{
new car = GetPlayerVehicleID(playerid);
obj[playerid] = CreatePlayerObject(playerid,19300, 0.0000, -1282.9984, 10.1493, 0.0000, -1, -1, 100);
AttachPlayerObjectToVehicle(playerid,obj[playerid],car,-0.314999, -0.195000, 0.510000, 0.000000, 0.000000, 0.000000);
AttachCameraToPlayerObject(playerid,obj[playerid]);
SetPVarInt(playerid,"used",1);
}
else
{
SetCameraBehindPlayer(playerid);
DestroyPlayerObject(playerid,obj[playerid]);
SetPVarInt(playerid,"used",0);
}
}